ironic.conductor.notification_utils module

ironic.conductor.notification_utils.emit_console_notification(task, action, status)[source]

Helper for conductor sending a set console state notification.

Parameters
  • task – a TaskManager instance.

  • action – Action string to go in the EventType. Must be either ‘console_set’ or ‘console_restore’.

  • status – One of ironic.objects.fields.NotificationStatus.START, END or ERROR.

ironic.conductor.notification_utils.emit_power_set_notification(task, level, status, to_power)[source]

Helper for conductor sending a set power state notification.

Parameters
  • task – a TaskManager instance.

  • level – Notification level. One of ironic.objects.fields.NotificationLevel.ALL

  • status – Status to go in the EventType. One of ironic.objects.fields.NotificationStatus.SUCCESS or ERROR. ERROR indicates that ironic-conductor couldn’t retrieve the power state for this node, or that it couldn’t set the power state of the node.

  • to_power – the power state the conductor is attempting to set on the node. This is used instead of the node’s target_power_state attribute since the “baremetal.node.power_set.start” notification is sent early, before target_power_state is set on the node.

ironic.conductor.notification_utils.emit_power_state_corrected_notification(task, from_power)[source]

Helper for conductor sending a node power state corrected notification.

When ironic detects that the actual power state on a bare metal hardware is different from the power state on an ironic node (DB), the ironic node’s power state is corrected to be that of the bare metal hardware. A notification is emitted about this after the database is updated to reflect this correction.

Parameters
  • task – a TaskManager instance.

  • from_power – the power state of the node before this change was detected

ironic.conductor.notification_utils.emit_provision_set_notification(task, level, status, prev_state, prev_target, event)[source]

Helper for conductor sending a set provision state notification.

Parameters
  • task – a TaskManager instance.

  • level – One of fields.NotificationLevel.

  • status – One of fields.NotificationStatus.

  • prev_state – Previous provision state.

  • prev_target – Previous target provision state.

  • event – FSM event that triggered provision state change.