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
=== modified file 'src/metadataserver/api.py'
--- src/metadataserver/api.py 2014-09-24 23:31:30 +0000
+++ src/metadataserver/api.py 2014-10-21 23:07:52 +0000
@@ -279,7 +279,15 @@
279279
280 if node.status == NODE_STATUS.COMMISSIONING:280 if node.status == NODE_STATUS.COMMISSIONING:
281 self._store_commissioning_results(node, request)281 self._store_commissioning_results(node, request)
282 store_node_power_parameters(node, request)282 # XXX 2014-10-21 newell, bug=1382075
283 # Auto detection for IPMI tries to save power parameters
284 # for Moonshot. This causes issues if the node's power type
285 # is already MSCM as it uses SSH instead of IPMI. This fix
286 # is temporary as power parameters should not be overwritten
287 # during commissioning because MAAS already has knowledge to
288 # boot the node.
289 if node.power_type != "mscm":
290 store_node_power_parameters(node, request)
283 target_status = self.signaling_statuses.get(status)291 target_status = self.signaling_statuses.get(status)
284 elif node.status == NODE_STATUS.DEPLOYING:292 elif node.status == NODE_STATUS.DEPLOYING:
285 self._store_installing_results(node, request)293 self._store_installing_results(node, request)
286294
=== modified file 'src/metadataserver/tests/test_api.py'
--- src/metadataserver/tests/test_api.py 2014-10-09 16:32:04 +0000
+++ src/metadataserver/tests/test_api.py 2014-10-21 23:07:52 +0000
@@ -793,6 +793,21 @@
793 node = reload_object(node)793 node = reload_object(node)
794 self.assertEqual(0, len(node.tags.all()))794 self.assertEqual(0, len(node.tags.all()))
795795
796 def test_signal_current_power_type_mscm_does_not_store_params(self):
797 node = factory.make_Node(
798 power_type="mscm", status=NODE_STATUS.COMMISSIONING)
799 client = make_node_client(node=node)
800 params = dict(
801 power_address=factory.make_string(),
802 power_user=factory.make_string(),
803 power_pass=factory.make_string())
804 response = call_signal(
805 client, power_type="moonshot", power_parameters=json.dumps(params))
806 self.assertEqual(httplib.OK, response.status_code, response.content)
807 node = reload_object(node)
808 self.assertEqual("mscm", node.power_type)
809 self.assertNotEqual(params, node.power_parameters)
810
796 def test_signal_refuses_bad_power_type(self):811 def test_signal_refuses_bad_power_type(self):
797 node = factory.make_Node(status=NODE_STATUS.COMMISSIONING)812 node = factory.make_Node(status=NODE_STATUS.COMMISSIONING)
798 client = make_node_client(node=node)813 client = make_node_client(node=node)

Subscribers

People subscribed via source and target branches

to all changes: