added check when deleting links to avoid exceptions from gui driven deletions
This commit is contained in:
parent
ccf5a5de60
commit
554f4a570d
1 changed files with 10 additions and 8 deletions
|
@ -363,16 +363,18 @@ class Session(object):
|
|||
node_two.delnetif(interface_two.netindex)
|
||||
elif node_one and net_one:
|
||||
interface = node_one.netif(interface_one_id)
|
||||
logging.info("deleting link node(%s):interface(%s) node(%s)",
|
||||
node_one.name, interface.name, net_one.name)
|
||||
interface.detachnet()
|
||||
node_one.delnetif(interface.netindex)
|
||||
if interface:
|
||||
logging.info("deleting link node(%s):interface(%s) node(%s)",
|
||||
node_one.name, interface.name, net_one.name)
|
||||
interface.detachnet()
|
||||
node_one.delnetif(interface.netindex)
|
||||
elif node_two and net_one:
|
||||
interface = node_two.netif(interface_two_id)
|
||||
logging.info("deleting link node(%s):interface(%s) node(%s)",
|
||||
node_two.name, interface.name, net_one.name)
|
||||
interface.detachnet()
|
||||
node_two.delnetif(interface.netindex)
|
||||
if interface:
|
||||
logging.info("deleting link node(%s):interface(%s) node(%s)",
|
||||
node_two.name, interface.name, net_one.name)
|
||||
interface.detachnet()
|
||||
node_two.delnetif(interface.netindex)
|
||||
finally:
|
||||
if node_one:
|
||||
node_one.lock.release()
|
||||
|
|
Loading…
Reference in a new issue