summaryrefslogtreecommitdiff
path: root/nics
diff options
context:
space:
mode:
authorLijuan Tu <lijuanx.a.tu@intel.com>2017-03-28 09:55:24 +0800
committerMarvin Liu <yong.liu@intel.com>2017-03-29 14:46:56 +0800
commit96fe0982780e86aef7899c60b242ca97b7aa8ff5 (patch)
treeadd07908ad9c5855e0c08ddaeb9648b27274a745 /nics
parent4fd7993e68be055837d04dacc84fda4bc1de3823 (diff)
nics/net_device: fix list remove bug
Remove all the match network device object by copy list first. Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
Diffstat (limited to 'nics')
-rw-r--r--nics/net_device.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nics/net_device.py b/nics/net_device.py
index ba3d9c2..0af4ad5 100644
--- a/nics/net_device.py
+++ b/nics/net_device.py
@@ -885,7 +885,7 @@ def remove_from_list(host):
Remove network device object from global structure
Parameter will by host ip
"""
- for nic in NICS_LIST:
+ for nic in NICS_LIST[:]:
if host == nic['host']:
NICS_LIST.remove(nic)