=== modified file 'cloudinit/net/__init__.py'
--- cloudinit/net/__init__.py 2016-07-14 02:45:19 +0000
+++ cloudinit/net/__init__.py 2016-09-20 15:35:26 +0000
@@ -116,9 +116,14 @@
fname = os.path.join(SYS_CLASS_NET, name, field)
if not os.path.exists(fname):
raise OSError("%s: could not find sysfs entry: %s" % (name, fname))
- data = util.load_file(fname)
- if data[-1] == '\n':
- data = data[:-1]
+ try:
+ data = util.load_file(fname)
+ if data[-1] == '\n':
+ data = data[:-1]
+ except IOError as e:
+ msg = "%s: load file failed with %s" % (fname, e))
+ util.logexc(LOG, msg)
+ raise OSError(msg)
return data