Merge lp:~jason-hobbs/maas/allow-releasing-from-failed-states-lp-1384821 into lp:~maas-committers/maas/trunk

Proposed by Jason Hobbs
Status: Merged
Approved by: Jason Hobbs
Approved revision: no longer in the source branch.
Merged at revision: 3300
Proposed branch: lp:~jason-hobbs/maas/allow-releasing-from-failed-states-lp-1384821
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 10 lines (+2/-0)
1 file modified
src/maasserver/models/node.py (+2/-0)
To merge this branch: bzr merge lp:~jason-hobbs/maas/allow-releasing-from-failed-states-lp-1384821
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Christian Reis (community) Needs Information
Review via email: mp+239519@code.launchpad.net

Commit message

Allow releasing from FAILED_DISK_ERASING and FAILED_RELEASING. This gives the API the same capability as the UI.

To post a comment you must log in.
Revision history for this message
Christian Reis (kiko) wrote :

No tests?

review: Needs Information
Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

There is already a test that covers releasing nodes in all releasable states. I guess we could add a test that the contents of RELEASABLE_STATES is what we expect it to be, but I don't think that's a valuable test.

Revision history for this message
Christian Reis (kiko) wrote :

Ah, there is no functional test of the API in-tree?

Revision history for this message
Julian Edwards (julian-edwards) wrote :

The tests are all generic and use the predefined lists, so amending the lists is fine.

review: Approve
Revision history for this message
Julian Edwards (julian-edwards) wrote :

One question though, what happens in the web UI when you try to release a node that already failed releasing?

Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

kiko, the in tree tests are very much whitebox unit tests.

Julian, the release process is started again. If disk erasing is enabled, the node's disks are erased; if disk erasing isn't enabled MAAS tries to power the node off.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/models/node.py'
2--- src/maasserver/models/node.py 2014-10-21 07:20:14 +0000
3+++ src/maasserver/models/node.py 2014-10-23 23:21:37 +0000
4@@ -383,6 +383,8 @@
5 NODE_STATUS.DEPLOYING,
6 NODE_STATUS.DEPLOYED,
7 NODE_STATUS.FAILED_DEPLOYMENT,
8+ NODE_STATUS.FAILED_DISK_ERASING,
9+ NODE_STATUS.FAILED_RELEASING,
10 ]
11
12