Merge lp:~newell-jensen/maas/mscm-hack-1382075 into lp:~maas-committers/maas/trunk

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

Commit message

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

Description of the change

This change was first implemented in maas/1.7. At the time, we were planning on landing a more general fix for trunk. However, as seen in discussion of https://code.launchpad.net/~newell-jensen/maas/no-ipmi-locate-commissioning-bug-1389808/+merge/240995 we are going forward with this change in trunk, at least for the time being.

To post a comment you must log in.
Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

Approve, but the comment needs a little fixing.

review: Approve
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Wasn't this already fixed in a previous MP that was merged in trunk and then backported to 1.7?

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

No. Opposite occurred. As the description part of the MP states, we put
the fix in 1.7 thinking that we would do something for trunk and moving
forward but because of the discussion of the MP for bug 138980, Kiko wanted
me to put the same fix in trunk.

On Mon, Nov 10, 2014 at 5:55 PM, Andres Rodriguez <email address hidden>
wrote:

> Review: Needs Information
>
> Wasn't this already fixed in a previous MP that was merged in trunk and
> then backported to 1.7?
> --
>
> https://code.launchpad.net/~newell-jensen/maas/mscm-hack-1382075/+merge/241345
> You are the owner of lp:~newell-jensen/maas/mscm-hack-1382075.
>

Revision history for this message
Christian Reis (kiko) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (19.8 KiB)

The attempt to merge lp:~newell-jensen/maas/mscm-hack-1382075 into lp:maas failed. Below is the output from the failed tests.

Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Ign http://security.ubuntu.com trusty-security InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Get:2 http://security.ubuntu.com trusty-security Release [62.0 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates Release [62.0 kB]
Get:5 http://security.ubuntu.com trusty-security/main Sources [49.5 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Get:6 http://security.ubuntu.com trusty-security/universe Sources [13.1 kB]
Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [153 kB]
Get:8 http://security.ubuntu.com trusty-security/universe amd64 Packages [60.5 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Get:9 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [136 kB]
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Get:10 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [89.5 kB]
Get:11 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [356 kB]
Get:12 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [217 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Fetched 1,200 kB in 2s (418 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 authbind bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools gjs ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make pep8 postgresql pyflakes python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-extras python-fixtures python-flake8 python-formencode python-hivex python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-mimeparse python-mock python-netaddr python-netifaces python-nose python-oauth python-oops python-oops-amqp python-oops-datedir-repo python-oops-twisted python-oops-wsgi python...

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-11-07 06:10:40 +0000
3+++ src/metadataserver/api.py 2014-11-11 04:31:47 +0000
4@@ -286,7 +286,17 @@
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+ # See MP discussion bug=1389808, for further details on why
17+ # we are using bug fix 1382075 here.
18+ if node.power_type != "mscm":
19+ store_node_power_parameters(node, request)
20 node.stop_transition_monitor()
21 target_status = self.signaling_statuses.get(status)
22 elif node.status == NODE_STATUS.DEPLOYING:
23
24=== modified file 'src/metadataserver/tests/test_api.py'
25--- src/metadataserver/tests/test_api.py 2014-11-07 06:10:19 +0000
26+++ src/metadataserver/tests/test_api.py 2014-11-11 04:31:47 +0000
27@@ -816,6 +816,21 @@
28 node = reload_object(node)
29 self.assertEqual(0, len(node.tags.all()))
30
31+ def test_signal_current_power_type_mscm_does_not_store_params(self):
32+ node = factory.make_Node(
33+ power_type="mscm", status=NODE_STATUS.COMMISSIONING)
34+ client = make_node_client(node=node)
35+ params = dict(
36+ power_address=factory.make_string(),
37+ power_user=factory.make_string(),
38+ power_pass=factory.make_string())
39+ response = call_signal(
40+ client, power_type="moonshot", power_parameters=json.dumps(params))
41+ self.assertEqual(httplib.OK, response.status_code, response.content)
42+ node = reload_object(node)
43+ self.assertEqual("mscm", node.power_type)
44+ self.assertNotEqual(params, node.power_parameters)
45+
46 def test_signal_refuses_bad_power_type(self):
47 node = factory.make_Node(status=NODE_STATUS.COMMISSIONING)
48 client = make_node_client(node=node)