Skip to content

Commit 76b2777

Browse files
authored
Sync ironic maintenance state with netboxes (#1755)
Unconditionally sync ironic node maintenance state with all netboxes during ironic sync. The field is only set through the listener based on events and may become inconsistent if not all secondary netboxes can be reached. Signed-off-by: Jan Horstmann <[email protected]>
1 parent 1317c3e commit 76b2777

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

osism/tasks/conductor/ironic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,11 @@ def sync_ironic(request_id, get_ironic_parameters, node_name=None, force_update=
226226
)
227227
node = openstack.baremetal_node_create(device.name, node_attributes)
228228
else:
229-
# NOTE: The listener service only reacts to changes in the baremetal node. Explicitly sync provision and power state in case updates were missed by the listener.
229+
# NOTE: The listener service only reacts to changes in the baremetal node. Explicitly sync provision, power state and maintenance in case updates were missed by the listener.
230230
# This sync is done unconditionally, because we do not know the state of secondary netboxes at this point
231231
netbox.set_provision_state(device.name, node["provision_state"])
232232
netbox.set_power_state(device.name, node["power_state"])
233+
netbox.set_maintenance(device.name, state=node["is_maintenance"])
233234
# NOTE: Check whether the baremetal node needs to be updated
234235
node_updates = {}
235236
deep_compare(node_attributes, node, node_updates)

0 commit comments

Comments
 (0)