Merge ~adam-collard/maas:2.3-fix into maas:2.3

Proposed by Adam Collard
Status: Merged
Approved by: Adam Collard
Approved revision: da2a1b0396accd62d72fa2428c8368a2593bc65c
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~adam-collard/maas:2.3-fix
Merge into: maas:2.3
Diff against target: 33 lines (+11/-1)
2 files modified
src/maasserver/websockets/handlers/machine.py (+1/-1)
src/maasserver/websockets/handlers/tests/test_machine.py (+10/-0)
Reviewer Review Type Date Requested Status
Lee Trager (community) Approve
MAAS Lander Approve
Review via email: mp+374856@code.launchpad.net

Commit message

Fix regression introduced in 182d29396be7019

Fixes LP:1835480, don't call dehydrate_pod method which doesn't exist

To post a comment you must log in.
Revision history for this message
Lee Trager (ltrager) wrote :

182d29396be7019 is a backport of 3a0114c which is how dehydrate_pod snuck in. Do you know if the UI for Pods works in 2.3? We may need to backport dehydrate_pod as well, or we may be able to remove this code completely.

It also seems we have a gap in unit testing as this should of been caught by the CI.

review: Needs Information
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b 2.3-fix lp:~adam-collard/maas/+git/maas into -b 2.3 lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 386d095e15ba3d7ac0c36739f5ff7d1c43405f48

review: Approve
~adam-collard/maas:2.3-fix updated
da2a1b0... by Adam Collard

Add test for dehydrating machine on pod

Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b 2.3-fix lp:~adam-collard/maas/+git/maas into -b 2.3 lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci-jenkins.internal:8080/job/maas/job/branch-tester/6914/console
COMMIT: 64686d080ec22ef0672a67998864af174cb22806

review: Needs Fixing
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b 2.3-fix lp:~adam-collard/maas/+git/maas into -b 2.3 lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: da2a1b0396accd62d72fa2428c8368a2593bc65c

review: Approve
Revision history for this message
Lee Trager (ltrager) wrote :

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/websockets/handlers/machine.py b/src/maasserver/websockets/handlers/machine.py
2index ca505d9..c9d441b 100644
3--- a/src/maasserver/websockets/handlers/machine.py
4+++ b/src/maasserver/websockets/handlers/machine.py
5@@ -260,7 +260,7 @@ class MachineHandler(NodeHandler):
6
7 if not for_list:
8 if obj.bmc is not None and obj.bmc.bmc_type == BMC_TYPE.POD:
9- data['pod'] = self.dehydrate_pod(obj.bmc)
10+ data['pod'] = obj.bmc.id
11 # Add info specific to a machine.
12 data["show_os_info"] = self.dehydrate_show_os_info(obj)
13 devices = [
14diff --git a/src/maasserver/websockets/handlers/tests/test_machine.py b/src/maasserver/websockets/handlers/tests/test_machine.py
15index 0617b68..f2a5e1e 100644
16--- a/src/maasserver/websockets/handlers/tests/test_machine.py
17+++ b/src/maasserver/websockets/handlers/tests/test_machine.py
18@@ -2965,6 +2965,16 @@ class TestMachineHandler(MAASServerTestCase):
19 "disk_type": Equals('iscsi')
20 })]))
21
22+ def test_dehydrate_machine_on_pod(self):
23+ user = factory.make_admin()
24+ handler = MachineHandler(user, {})
25+ pod = factory.make_Pod()
26+ architecture = make_usable_architecture(self)
27+ node = factory.make_Node(interface=True, architecture=architecture)
28+ node.bmc = pod
29+ observed = handler.get({"system_id": node.system_id})
30+ self.assertEqual(observed['pod'], pod.id)
31+
32
33 class TestMachineHandlerCheckPower(MAASTransactionServerTestCase):
34

Subscribers

People subscribed via source and target branches