Merge lp:~newell-jensen/maas/1.7-fix-bug-1382075 into lp:maas/1.7

Proposed by Newell Jensen
Status: Merged
Approved by: Andres Rodriguez
Approved revision: no longer in the source branch.
Merged at revision: 3273
Proposed branch: lp:~newell-jensen/maas/1.7-fix-bug-1382075
Merge into: lp:maas/1.7
Diff against target: 46 lines (+24/-1)
2 files modified
src/metadataserver/api.py (+9/-1)
src/metadataserver/tests/test_api.py (+15/-0)
To merge this branch: bzr merge lp:~newell-jensen/maas/1.7-fix-bug-1382075
Reviewer Review Type Date Requested Status
Christian Reis (community) Needs Information
Jason Hobbs (community) Approve
Review via email: mp+239147@code.launchpad.net

Commit message

Only save node power parameters via the metadataserver.api if the current node power type is not "mscm".

To post a comment you must log in.
Revision history for this message
Newell Jensen (newell-jensen) wrote :

Currently have this queued in CI.

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

Comment inline

Revision history for this message
Newell Jensen (newell-jensen) :
Revision history for this message
Newell Jensen (newell-jensen) wrote :

Jason, go ahead and have another look.

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

Approved, with a comment inline.

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

Actually approve.

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

Before landing this, could you please get Sean and Narinder to test, and can you test on non-moonshot systems to ensure this doesn't regress?

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

Just a small point, but presumably this is going to land in trunk as well? If
so, it's customary to land there first, and then merge the trunk revision back
into the older branch. I think I went through this with Newell before :)

Revision history for this message
Newell Jensen (newell-jensen) wrote :

Julian,

This branch is *only* going to be for 1.7, hence the reason for not doing it in trunk first and then doing a back port.

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

Right. The correct fix for trunk involves changing the commissioning semantics.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/metadataserver/api.py'
2--- src/metadataserver/api.py 2014-09-24 23:31:30 +0000
3+++ src/metadataserver/api.py 2014-10-21 23:07:52 +0000
4@@ -279,7 +279,15 @@
5
6 if node.status == NODE_STATUS.COMMISSIONING:
7 self._store_commissioning_results(node, request)
8- store_node_power_parameters(node, request)
9+ # XXX 2014-10-21 newell, bug=1382075
10+ # Auto detection for IPMI tries to save power parameters
11+ # for Moonshot. This causes issues if the node's power type
12+ # is already MSCM as it uses SSH instead of IPMI. This fix
13+ # is temporary as power parameters should not be overwritten
14+ # during commissioning because MAAS already has knowledge to
15+ # boot the node.
16+ if node.power_type != "mscm":
17+ store_node_power_parameters(node, request)
18 target_status = self.signaling_statuses.get(status)
19 elif node.status == NODE_STATUS.DEPLOYING:
20 self._store_installing_results(node, request)
21
22=== modified file 'src/metadataserver/tests/test_api.py'
23--- src/metadataserver/tests/test_api.py 2014-10-09 16:32:04 +0000
24+++ src/metadataserver/tests/test_api.py 2014-10-21 23:07:52 +0000
25@@ -793,6 +793,21 @@
26 node = reload_object(node)
27 self.assertEqual(0, len(node.tags.all()))
28
29+ def test_signal_current_power_type_mscm_does_not_store_params(self):
30+ node = factory.make_Node(
31+ power_type="mscm", status=NODE_STATUS.COMMISSIONING)
32+ client = make_node_client(node=node)
33+ params = dict(
34+ power_address=factory.make_string(),
35+ power_user=factory.make_string(),
36+ power_pass=factory.make_string())
37+ response = call_signal(
38+ client, power_type="moonshot", power_parameters=json.dumps(params))
39+ self.assertEqual(httplib.OK, response.status_code, response.content)
40+ node = reload_object(node)
41+ self.assertEqual("mscm", node.power_type)
42+ self.assertNotEqual(params, node.power_parameters)
43+
44 def test_signal_refuses_bad_power_type(self):
45 node = factory.make_Node(status=NODE_STATUS.COMMISSIONING)
46 client = make_node_client(node=node)

Subscribers

People subscribed via source and target branches

to all changes: