Merge lp:~lamont/maas/bug-1567249-1.9 into lp:maas/1.9

Proposed by LaMont Jones
Status: Merged
Approved by: LaMont Jones
Approved revision: no longer in the source branch.
Merged at revision: 4590
Proposed branch: lp:~lamont/maas/bug-1567249-1.9
Merge into: lp:maas/1.9
Diff against target: 79 lines (+35/-1)
3 files modified
docs/changelog.rst (+2/-0)
src/maasserver/clusterrpc/power_parameters.py (+15/-1)
src/maasserver/clusterrpc/tests/test_power_parameters.py (+18/-0)
To merge this branch: bzr merge lp:~lamont/maas/bug-1567249-1.9
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+299608@code.launchpad.net

Commit message

Complain intelligently if the rack controller is running an old version (1.7) of maas (missing_packages was introduced in revno 4343)

Description of the change

Complain intelligently if the rack controller is running an old version (1.7) of maas (missing_packages was introduced in revno 4343)

A 1.7 cluster controller would successfully connect to a 1.9 region controller, and the first that anyone would have any issues was when they went to look at a node (not cluster/rack controller..) and got a KeyError traceback. Detecting this error and giving the admin a hint of why they're seeing this strange thing keeps then from diving down the rabbit hole.

With a 2.0 region controller, the 1.7 (and 1.9) cluster/rack controllers fail to connect at all, so it becomes clear that "there's an issue with cluster controller $FOO" rather quickly, and the obvious investigative actions lead to the right problem being found.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good, but no test?

The description also makes since and why this is not needed in 2.0+.

review: Needs Fixing
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

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

The attempt to merge lp:~lamont/maas/bug-1567249-1.9 into lp:maas/1.9 failed. Below is the output from the failed tests.

Hit http://security.ubuntu.com trusty-security InRelease
Ign http://prodstack-zone-1.clouds.archive.ubuntu.com trusty InRelease
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates InRelease
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports InRelease
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty Release.gpg
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty Release
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/main Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/restricted Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/universe Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/multiverse Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/main amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/restricted amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/universe amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/multiverse amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/main Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/restricted Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/multiverse Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/multiverse amd64 Packages
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 authbind bind9 bind9utils build-essential bzr-builddeb chromium-browser chromium-chromedriver curl daemontools debhelper dh-apport dh-systemd distro-info dnsutils fire...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/changelog.rst'
--- docs/changelog.rst 2016-06-30 17:36:38 +0000
+++ docs/changelog.rst 2016-07-11 16:38:15 +0000
@@ -19,6 +19,8 @@
1919
20LP: #1597460 [1.9] MAAS 1.9 should only download filetypes from a SimpleStream is can process20LP: #1597460 [1.9] MAAS 1.9 should only download filetypes from a SimpleStream is can process
2121
22LP: #1567249 [1.9] If rack and region have different versions, the error is uninformative and confusing.
23
221.9.3241.9.3
23=====25=====
2426
2527
=== modified file 'src/maasserver/clusterrpc/power_parameters.py'
--- src/maasserver/clusterrpc/power_parameters.py 2015-10-19 04:54:14 +0000
+++ src/maasserver/clusterrpc/power_parameters.py 2016-07-11 16:38:15 +0000
@@ -40,6 +40,7 @@
40from jsonschema import validate40from jsonschema import validate
41from maasserver.clusterrpc.utils import call_clusters41from maasserver.clusterrpc.utils import call_clusters
42from maasserver.config_forms import DictCharField42from maasserver.config_forms import DictCharField
43from maasserver.exceptions import ClusterUnavailable
43from maasserver.fields import MACAddressFormField44from maasserver.fields import MACAddressFormField
44from maasserver.utils.forms import compose_invalid_choice_text45from maasserver.utils.forms import compose_invalid_choice_text
45from provisioningserver.power.schema import (46from provisioningserver.power.schema import (
@@ -199,7 +200,20 @@
199 name = power_type['name']200 name = power_type['name']
200 fields = power_type['fields']201 fields = power_type['fields']
201 description = power_type['description']202 description = power_type['description']
202 missing_packages = power_type['missing_packages']203 try:
204 missing_packages = power_type['missing_packages']
205 except KeyError:
206 msg = (
207 """Bad response from cluster controller. This likely """
208 """means that it is running an earlier version of MAAS.""")
209 if nodegroups is not None:
210 if len(nodegroups) == 1:
211 msg += " Controller: "
212 else:
213 msg += " Controllers: "
214 msg += ", ".join([ctl.name for ctl in nodegroups])
215 msg += "."
216 raise ClusterUnavailable(msg)
203 add_power_type_parameters(217 add_power_type_parameters(
204 name, description, fields, missing_packages, merged_types)218 name, description, fields, missing_packages, merged_types)
205 return sorted(merged_types, key=itemgetter("description"))219 return sorted(merged_types, key=itemgetter("description"))
206220
=== modified file 'src/maasserver/clusterrpc/tests/test_power_parameters.py'
--- src/maasserver/clusterrpc/tests/test_power_parameters.py 2015-10-01 22:48:50 +0000
+++ src/maasserver/clusterrpc/tests/test_power_parameters.py 2016-07-11 16:38:15 +0000
@@ -27,6 +27,7 @@
27 POWER_TYPE_PARAMETER_FIELD_SCHEMA,27 POWER_TYPE_PARAMETER_FIELD_SCHEMA,
28)28)
29from maasserver.config_forms import DictCharField29from maasserver.config_forms import DictCharField
30from maasserver.exceptions import ClusterUnavailable
30from maasserver.fields import MACAddressFormField31from maasserver.fields import MACAddressFormField
31from maasserver.testing.factory import factory32from maasserver.testing.factory import factory
32from maasserver.testing.testcase import MAASServerTestCase33from maasserver.testing.testcase import MAASServerTestCase
@@ -322,3 +323,20 @@
322 self.assertThat(323 self.assertThat(
323 mocked, MockCalledOnceWith(324 mocked, MockCalledOnceWith(
324 sentinel.nodegroup, sentinel.ignore_errors))325 sentinel.nodegroup, sentinel.ignore_errors))
326
327 def test_get_power_types_detects_missing_missing_packages_key(self):
328 mocked = self.patch(power_parameters, "call_clusters")
329 mocked.return_value = [{
330 'power_types': [
331 {'name': "virsh", 'fields': "foo", 'description': "desc"},
332 {'name': "other", 'fields': "bar", 'description': "meh"},
333 ],
334 }]
335 e = self.assertRaises(
336 ClusterUnavailable,
337 power_parameters.get_all_power_types_from_clusters
338 )
339 self.assertEqual(
340 """Bad response from cluster controller. This likely """
341 """means that it is running an earlier version of MAAS.""",
342 e.message)

Subscribers

People subscribed via source and target branches