Removing the subnets from shared networks
RM8483 Created regression in the test_networks suite. Can only test 'getting' a shared net here. It isn't possible, without modifications to the mock, to test 'not getting' a shared net. I considered modifying the mock but then all these tests would pretty much be testing my new mock instead of actual things. All this is supposed to do is ensure that, if a network is shared, the subnets are not included in the output. Updated the not shared check to ensure correctness.
This commit is contained in:
@@ -54,11 +54,14 @@ def _make_network_dict(network, fields=None):
|
||||
"ipam_strategy": network.get("ipam_strategy"),
|
||||
"status": "ACTIVE",
|
||||
"shared": shared_net}
|
||||
if fields and "all_subnets" in fields:
|
||||
res["subnets"] = [_make_subnet_dict(s)
|
||||
for s in network.get("subnets", [])]
|
||||
if not shared_net:
|
||||
if fields and "all_subnets" in fields:
|
||||
res["subnets"] = [_make_subnet_dict(s)
|
||||
for s in network.get("subnets", [])]
|
||||
else:
|
||||
res["subnets"] = [s["id"] for s in network.get("subnets", [])]
|
||||
else:
|
||||
res["subnets"] = [s["id"] for s in network.get("subnets", [])]
|
||||
res["subnets"] = []
|
||||
return res
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user