Change in vdsm[master]: ifcfg.removeNic: ignore missing host interface

danken at redhat.com danken at redhat.com
Tue Feb 25 11:53:51 UTC 2014


Dan Kenigsberg has uploaded a new change for review.

Change subject: ifcfg.removeNic: ignore missing host interface
......................................................................

ifcfg.removeNic: ignore missing host interface

There may be cases where the Ifcfg configurator is asked to remove a Nic
that is no longer exist on the host. This can happen if the device was
renamed by an administrator or if it was unplugged from the system.

In this patch we do not try to ifup the missing device.

Change-Id: Ia892202b837f4515cd44a3b485fbe1b2a447457c
Bug-Url: https://bugzilla.redhat.com/1059773
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/netconf/ifcfg.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/09/25009/1

diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index 446cefb..d171885 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -199,7 +199,11 @@
             self.configApplier.removeNic(nic.name)
         else:
             self._setNewMtu(nic, _netinfo.getVlanDevsForIface(nic.name))
-        ifup(nic.name)
+
+        if nic.name in _netinfo.nics:
+            ifup(nic.name)
+        else:
+            logging.warning('host interface %s missing', nic.name)
 
     def _getFilePath(self, fileType, device):
         return os.path.join(netinfo.NET_CONF_DIR, '%s-%s' % (fileType, device))


-- 
To view, visit http://gerrit.ovirt.org/25009
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia892202b837f4515cd44a3b485fbe1b2a447457c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list