Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/maasserver/models/signals/tests/test_power.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ def test_changing_status_of_node_emits_event(self):
node.system_id
)

def test_commissioning_to_new_emits_query_event(self):
self.patch_autospec(power, "update_power_state_of_node_soon")
node = factory.make_Node(
status=NODE_STATUS.COMMISSIONING, power_type="virsh"
)
node.update_status(NODE_STATUS.NEW)

with post_commit_hooks:
node.save()
power.update_power_state_of_node_soon.assert_not_called()

post_commit_hooks.fire()
power.update_power_state_of_node_soon.assert_called_once_with(
node.system_id
)

def test_changing_not_tracked_status_of_node_doesnt_emit_event(self):
self.patch_autospec(power, "update_power_state_of_node_soon")
old_status = NODE_STATUS.ALLOCATED
Expand Down
1 change: 1 addition & 0 deletions src/maasserver/node_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@
None: [NODE_STATUS.NEW],
NODE_STATUS.COMMISSIONING: [
NODE_STATUS.FAILED_COMMISSIONING,
NODE_STATUS.NEW,
NODE_STATUS.READY,
],
NODE_STATUS.DEPLOYING: [
Expand Down
Loading