Replace link_remove with link delete

Disconnects a container from network, cleanup veth pairs occurs, but
warning info raise from iprouter2: WARNING pyroute2.iproute [-]
link_remove() is obsoleted, use link('del', ...)

We can replace the obsoleted method in kuryr-lib.

Change-Id: I4fbf45b49415ee76983a441566ccec55b1adb543
Closes-Bug: #1626427
This commit is contained in:
Dongcan Ye 2016-09-22 15:49:10 +08:00 committed by Antoni Segura Puimedon
parent 854a8028b6
commit dc4ec4e7c6
No known key found for this signature in database
GPG Key ID: 2329618D2967720A
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ def remove_device(ifname):
devices = ipr.link_lookup(ifname=ifname)
if devices:
dev_index = devices[0]
ipr.link_remove(dev_index)
ipr.link('del', index=dev_index)
return dev_index
else:
return None