added check when deleting links to avoid exceptions from gui driven deletions

This commit is contained in:
Blake Harnden 2019-07-19 07:46:17 -07:00
parent ccf5a5de60
commit 554f4a570d

View file

@ -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()