Fix interface cleanup
This commit is contained in:
+11
-6
@@ -253,12 +253,17 @@ def delete_endpoint():
|
|||||||
if_host, _if_container = veth_pair(req['EndpointID'])
|
if_host, _if_container = veth_pair(req['EndpointID'])
|
||||||
if_host = interface.GetInterface(LIBRARY, if_host)
|
if_host = interface.GetInterface(LIBRARY, if_host)
|
||||||
|
|
||||||
if library == 'NDB':
|
try:
|
||||||
bridge = net_bridge(req['NetworkID'])
|
if LIBRARY == 'NDB':
|
||||||
interface.DelPort(LIBRARY, bridge.ifname, if_host.ifname)
|
logger.info('1')
|
||||||
else:
|
bridge = net_bridge(req['NetworkID'])
|
||||||
interface.DelPort(LIBRARY, 'dummy0', if_host.ifname)
|
interface.DelPort(LIBRARY, bridge.ifname, if_host.ifname)
|
||||||
interface.RemoveInterface(LIBRARY, if_host.ifname)
|
else:
|
||||||
|
logger.info('2')
|
||||||
|
interface.DelPort(LIBRARY, 'dummy0', if_host.ifname)
|
||||||
|
interface.RemoveInterface(LIBRARY, if_host.ifname)
|
||||||
|
except Exception as e:
|
||||||
|
logger.exception(e)
|
||||||
|
|
||||||
return jsonify({})
|
return jsonify({})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user