Commit 4d0a6629 by Adam Torok

update methods added to impls.

parent 4d452b14
......@@ -36,6 +36,14 @@ class OpenstackNetworkManager(NetworkManager):
return self.os_network_to_rc_network(os_network)
def update(self, id, params) -> Optional[Network]:
try:
os_network = self.openstack.network.update_network(id, **params)
except ResourceNotFound:
return None
return self.os_network_to_rc_network(os_network)
def delete(self, id) -> bool:
try:
self.openstack.network.delete_network(id)
......
......@@ -38,8 +38,11 @@ class OpenstackPortManager(PortManager):
return self.os_port_to_rc_port(os_port)
def update(self, id, params):
os_port = self.openstack.network.update_port(id, **params)
def update(self, id, params) -> Optional[Port]:
try:
os_port = self.openstack.network.update_port(id, **params)
except ResourceNotFound:
return None
return self.os_port_to_rc_port(os_port)
......
......@@ -35,6 +35,14 @@ class OpenstackRouterManager(RouterManager):
return self.os_router_to_rc_router(os_router)
def update(self, id, params) -> Optional[Router]:
try:
os_router = self.openstack.network.update_router(id, **params)
except ResourceNotFound:
return None
return self.os_router_to_rc_router(os_router)
def delete(self, id) -> bool:
try:
self.openstack.network.delete_router(id)
......
......@@ -43,6 +43,14 @@ class OpenstackSubnetManager(SubnetManager):
return self.os_subnet_to_rc_subnet(os_subnet)
def update(self, params) -> Optional[Subnet]:
try:
os_subnet = self.openstack.network.update_subnet(id, **params)
except ResourceNotFound:
return None
return self.os_subnet_to_rc_subnet(os_subnet)
def delete(self, id) -> bool:
try:
self.openstack.network.delete_subnet(id=id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment