Skip to content

Creations happen before deletions in Designs #263

@nkallergis

Description

@nkallergis

Environment

  • Python version: N/A
  • Nautobot version: 3.0 but should be the same in 2.x
  • nautobot-design-builder version: 3.0.0

Expected Convenient/Desired Behavior

During a Design Deployment run, deletions happen before creations. This way it will be both conceptually more sound but also much more convenient when the object at hand has to be unique (e.g. a Device has to be fully replaced).

Observed Behavior

Creations happen before deletions. (relevant code lines)

Steps to Reproduce

  1. Have a Design that creates_or_updates a Device with a specific DeviceType.
devices:
  - "create_or_update:name": "SW01"
    "create_or_update:device_type__model": "C1000"
    role__name: "Core Router"
    status__name: "Planned"
    platform: "!ref:junos_platform"
  1. Change the Design to use a different DeviceType.
devices:
  - "create_or_update:name": "SW01"
    "create_or_update:device_type__model": "C2000"
    role__name: "Core Router"
    status__name: "Planned"
    platform: "!ref:junos_platform"
  1. You get a validation error due to the Device's uniqueness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions