Skip to content

Conversation

@haseebsyed12
Copy link
Contributor

@haseebsyed12 haseebsyed12 commented Jan 20, 2026

  1. Fix Nautobot device, interface sync handling placeholder "None" string in switch_info

    • Skip placeholder "None" string in switch_info (set by port_bios_name_hook for Neutron compatibility)
    • Skips both Python None and the literal string "None" when looking up switch locations (The port_bios_name_hook sets local_link_connection with string "None" as a placeholder to satisfy Neutron validation. This was passing the if not switch_info check and causing unnecessary API calls to Nautobot with name=None query parameter).
  2. Handle uninspected nodes gracefully (no inventory yet)

    • Catch NotFound exception when fetching inventory for nodes that haven't been inspected yet
  3. Remove event trigger for baremetal.node.create.end

    • Remove baremetal.node.create.end from event handlers since newly created nodes lack inventory and location data needed for Nautobot (Nodes will now sync to Nautobot on provision_set.end (after inspection) or update.end events when full data is available.)
  4. Preserve rack location and position when recreating Nautobot device

    • copy location_id, rack_id, position, and face from old device before deleting on UUID mismatch and apply preserved values when updating new device

@haseebsyed12 haseebsyed12 requested a review from a team January 20, 2026 13:59
@haseebsyed12 haseebsyed12 marked this pull request as ready for review January 20, 2026 14:20
@haseebsyed12 haseebsyed12 force-pushed the handle_baremetal_node_create_event branch from baa37dc to 802bb02 Compare January 20, 2026 17:39
@haseebsyed12 haseebsyed12 changed the title fix(nautobot_device_sync): Split ironic-node-update sensor to handle create events separately fix(nautobot_device_sync): handle uninspected nodes gracefully Jan 20, 2026
@haseebsyed12 haseebsyed12 force-pushed the handle_baremetal_node_create_event branch from 802bb02 to 4227080 Compare January 20, 2026 17:42
The port_bios_name_hook sets local_link_connection with string "None"
as a placeholder to satisfy Neutron validation. This was passing the
`if not switch_info` check and causing unnecessary API calls to Nautobot
with `name=None` query parameter.

Now skips both Python None and the literal string "None" when looking
up switch locations.
- Remove baremetal.node.create.end from event handlers since newly
  created nodes lack inventory and location data needed for Nautobot
- Catch NotFound exception when fetching inventory for nodes that
  haven't been inspected yet
- Skip placeholder "None" string in switch_info (set by port_bios_name_hook
  for Neutron compatibility)
- Return failure with info log when no location available instead of
  error, as inspection event will trigger proper sync later

Nodes will now sync to Nautobot on provision_set.end (after inspection)
or update.end events when full data is available.
@haseebsyed12 haseebsyed12 force-pushed the handle_baremetal_node_create_event branch from 4227080 to 089971d Compare January 22, 2026 14:17
@haseebsyed12 haseebsyed12 changed the title fix(nautobot_device_sync): handle uninspected nodes gracefully fix(nautobot_device_sync): refactoring Jan 22, 2026
@haseebsyed12 haseebsyed12 changed the title fix(nautobot_device_sync): refactoring fix(nautobot_device_sync): PUC-1441: refactoring Jan 22, 2026
@haseebsyed12 haseebsyed12 force-pushed the handle_baremetal_node_create_event branch from d3e36e0 to 4192fda Compare January 22, 2026 17:50
@stevekeay stevekeay added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit 04d1dc1 Jan 23, 2026
60 checks passed
@stevekeay stevekeay deleted the handle_baremetal_node_create_event branch January 23, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants