Skip to content

Commit

Permalink
Implements: #2015
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Jun 6, 2024
1 parent 6f1f83d commit c3d5c3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libcloud/compute/drivers/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -3160,6 +3160,10 @@ def _to_network(self, obj):
extra["router:external"] = obj.get("router:external")
if obj.get("subnets", None):
extra["subnets"] = obj.get("subnets")
if obj.get("tags", None):
extra["tags"] = obj.get("tags")
if obj.get("is_default", None):
extra["is_default"] = obj.get("is_default")
return OpenStackNetwork(id=obj["id"], name=obj["name"], cidr=None, driver=self, extra=extra)

def ex_list_networks(self):
Expand Down
1 change: 1 addition & 0 deletions libcloud/test/compute/test_openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,7 @@ def test_ex_get_network(self):
self.assertEqual(network.id, "cc2dad14-827a-feea-416b-f13e50511a0a")
self.assertTrue(isinstance(network, OpenStackNetwork))
self.assertEqual(network.name, "net2")
self.assertEqual(network.extra["is_default"], False)

def test_ex_list_subnets(self):
subnets = self.driver.ex_list_subnets()
Expand Down

0 comments on commit c3d5c3d

Please sign in to comment.