Merge ~blake-rouse/maas:fix-1721548 into maas:master

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: 8e83a30faa1456b2d8f421dcdf6ce77b2c94c6ca
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~blake-rouse/maas:fix-1721548
Merge into: maas:master
Diff against target: 38 lines (+4/-0)
2 files modified
src/provisioningserver/rpc/cluster.py (+1/-0)
src/provisioningserver/rpc/tests/test_clusterservice.py (+3/-0)
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+331953@code.launchpad.net

Commit message

Fixes LP #1721548 - Failure on controller refresh seem to be causing version to not get updated.

Add maas_version to RefreshRackControllerInfo RPC response so the version will be sent over the wire to the region. Before the version was being calculated but it would not be sent over the wire. "maas_version" field is set to optional so older rack controllers that connect to the region do not error because that field will be missing.

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

lgtm!

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
~blake-rouse/maas:fix-1721548 updated
8e83a30... by Blake Rouse

Fix tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/provisioningserver/rpc/cluster.py b/src/provisioningserver/rpc/cluster.py
2index 907da7a..c5402f6 100644
3--- a/src/provisioningserver/rpc/cluster.py
4+++ b/src/provisioningserver/rpc/cluster.py
5@@ -601,6 +601,7 @@ class RefreshRackControllerInfo(amp.Command):
6 (b"osystem", amp.Unicode()),
7 (b"distro_series", amp.Unicode()),
8 (b"interfaces", StructureAsJSON()),
9+ (b"maas_version", amp.Unicode(optional=True)),
10 ]
11 errors = {
12 exceptions.RefreshAlreadyInProgress: (
13diff --git a/src/provisioningserver/rpc/tests/test_clusterservice.py b/src/provisioningserver/rpc/tests/test_clusterservice.py
14index 56f1436..8553d02 100644
15--- a/src/provisioningserver/rpc/tests/test_clusterservice.py
16+++ b/src/provisioningserver/rpc/tests/test_clusterservice.py
17@@ -2385,12 +2385,14 @@ class TestClusterProtocol_Refresh(
18 architecture = factory.make_name('architecture')
19 osystem = factory.make_name('osystem')
20 distro_series = factory.make_name('distro_series')
21+ maas_version = factory.make_name('maas_version')
22 self.patch_autospec(clusterservice, 'get_sys_info').return_value = {
23 'hostname': hostname,
24 'osystem': osystem,
25 'distro_series': distro_series,
26 'architecture': architecture,
27 'interfaces': {},
28+ 'maas_version': maas_version,
29 }
30
31 response = yield call_responder(
32@@ -2407,6 +2409,7 @@ class TestClusterProtocol_Refresh(
33 'osystem': osystem,
34 'distro_series': distro_series,
35 'architecture': architecture,
36+ 'maas_version': maas_version,
37 'interfaces': {},
38 }, response)
39

Subscribers

People subscribed via source and target branches