Change in vdsm[ovirt-3.5]: ifcfg: only deal gracefully with ENOENT in removeNic

osvoboda at redhat.com osvoboda at redhat.com
Thu Sep 17 13:43:15 UTC 2015


Hello Ido Barkan, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/46302

to review the following change.

Change subject: ifcfg: only deal gracefully with ENOENT in removeNic
......................................................................

ifcfg: only deal gracefully with ENOENT in removeNic

Any other IO errors are unexpected and so they should not go
unnoticed.

Change-Id: Ice4d6b248e8ff43fc8b9deeef07484111a3a3ebd
Bug-Url: https://bugzilla.redhat.com/1256252
Signed-off-by: Ondřej Svoboda <osvoboda at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/46197
Continuous-Integration: Jenkins CI
Reviewed-by: Ido Barkan <ibarkan at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/network/configurators/ifcfg.py
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/46302/1

diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index 6752ddd..a68a28d 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -662,7 +662,10 @@
                 hwlines = [line for line in nicFile if line.startswith(
                     'HWADDR=')]
         except IOError as e:
-            logging.warning("%s couldn't be read (errno %s)", cf, e.errno)
+            if e.errno != errno.ENOENT:
+                logging.error("%s couldn't be read (errno %s)", cf, e.errno)
+                raise
+            logging.warning("%s doesn't exist, reading HWADDR from system", cf)
             try:
                 hwlines = ['HWADDR=%s\n' % netinfo.gethwaddr(nic)]
             except IOError as e:


-- 
To view, visit https://gerrit.ovirt.org/46302
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice4d6b248e8ff43fc8b9deeef07484111a3a3ebd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list