network: add a helper function to list ports that doesn't raise
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
3ac48b77e1
commit
a86e9b7ab4
@ -321,6 +321,12 @@ class Network(app_manager.RyuApp):
|
||||
def list_ports(self, network_id):
|
||||
return self.networks.list_ports(network_id)
|
||||
|
||||
def list_ports_noraise(self, network_id):
|
||||
try:
|
||||
return self.list_ports(network_id)
|
||||
except NetworkNotFound:
|
||||
return []
|
||||
|
||||
def _update_port(self, network_id, dpid, port, port_may_exist):
|
||||
def _known_nw_id(nw_id):
|
||||
return nw_id is not None and nw_id != self.nw_id_unknown
|
||||
|
Loading…
Reference in New Issue
Block a user