← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~emdw/maas:fix_1959648_ws_vlan_handler_subnet_id_incl into maas:master

 

Eline Maaike De Weerd has proposed merging ~emdw/maas:fix_1959648_ws_vlan_handler_subnet_id_incl into maas:master.

Commit message:
included subnet ids with vlan returns

(please check if it's doing the right thing, was unsure about bug description)



Requested reviews:
  MAAS Maintainers (maas-maintainers)
Related bugs:
  Bug #1959648 in MAAS: "Websocket vlan handler should include associated subnet ids"
  https://bugs.launchpad.net/maas/+bug/1959648

For more details, see:
https://code.launchpad.net/~emdw/maas/+git/maas/+merge/440266
-- 
Your team MAAS Maintainers is requested to review the proposed merge of ~emdw/maas:fix_1959648_ws_vlan_handler_subnet_id_incl into maas:master.
diff --git a/src/maasserver/websockets/handlers/tests/test_vlan.py b/src/maasserver/websockets/handlers/tests/test_vlan.py
index 36e49f6..36f493c 100644
--- a/src/maasserver/websockets/handlers/tests/test_vlan.py
+++ b/src/maasserver/websockets/handlers/tests/test_vlan.py
@@ -48,6 +48,9 @@ class TestVLANHandler(MAASServerTestCase):
                 }
             )
         )
+        data["subnet_ids"] = sorted(
+            subnet.id for subnet in vlan.subnet_set.all()
+        )
         if not for_list:
             data["node_ids"] = sorted(
                 list(
diff --git a/src/maasserver/websockets/handlers/vlan.py b/src/maasserver/websockets/handlers/vlan.py
index c642143..7236d2c 100644
--- a/src/maasserver/websockets/handlers/vlan.py
+++ b/src/maasserver/websockets/handlers/vlan.py
@@ -67,6 +67,9 @@ class VLANHandler(TimestampedModelHandler):
         data["rack_sids"] = sorted(
             node.system_id for node in nodes if node.is_rack_controller
         )
+        data["subnet_ids"] = sorted(
+            subnet.id for subnet in obj.subnet_set.all()
+        )
         if not for_list:
             data["node_ids"] = sorted(node.id for node in nodes)
             data["space_ids"] = sorted(

Follow ups