Ubuntu Pastebin

Paste from smoser at Fri, 2 Dec 2016 21:13:45 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index a8d3fdc..121110a 100755
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -28,10 +28,6 @@ SYS_CLASS_NET = "/sys/class/net/"
 DEFAULT_PRIMARY_INTERFACE = 'eth0'
 
 
-def _on_excp_false(e):
-    return False
-
-
 def sys_dev_path(devname, path=""):
     return SYS_CLASS_NET + devname + "/" + path
 
@@ -66,10 +62,13 @@ def read_sys_net(devname, path, translate=None,
 
 
 def read_sys_net_safe(iface, field, translate=None):
+    def return_false(e):
+        return False
+
     return read_sys_net(iface, field,
-                        on_keyerror=_on_excp_false,
-                        on_enoent=_on_excp_false,
-                        on_einval=_on_excp_false,
+                        on_keyerror=return_false,
+                        on_enoent=return_false,
+                        on_einval=return_false,
                         translate=translate)
 
 
Download as text