1) Fix undefined client_utils reference.
2) Use a less generic ImportError catchall.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 client/net/net_utils.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/client/net/net_utils.py b/client/net/net_utils.py
index cc7d060..b267794 100644
--- a/client/net/net_utils.py
+++ b/client/net/net_utils.py
@@ -35,8 +35,7 @@ class network_utils(object):
                 autotest machine.
         @return: IP address which can communicate with query_ip
         """
-        ip = client_utils.system_output("ip addr show to %s/%s" %
-                                        (query_ip, netmask))
+        ip = utils.system_output("ip addr show to %s/%s" % (query_ip, netmask))
         ip = re.search(r"inet ([0-9.]*)/", ip)
         if ip is None:
             return ip
@@ -104,7 +103,7 @@ def network():
     try:
         from autotest.client.net import site_net_utils
         return site_net_utils.network_utils()
-    except Exception:
+    except ImportError:
         return network_utils()
 
 
@@ -113,7 +112,6 @@ class network_interface(object):
     ENABLE, DISABLE = (True, False)
 
     def __init__(self, name):
-        autodir = os.environ['AUTODIR']
         self.ethtool = 'ethtool'
         self._name = name
         self.was_down = self.is_down()
@@ -387,7 +385,7 @@ def netif(name):
     try:
         from autotest.client.net import site_net_utils
         return site_net_utils.network_interface(name)
-    except Exception:
+    except ImportError:
         return network_interface(name)
 
 
@@ -452,7 +450,7 @@ def bond():
     try:
         from autotest.client.net import site_net_utils
         return site_net_utils.bonding()
-    except Exception:
+    except ImportError:
         return bonding()
 
 
@@ -746,5 +744,5 @@ def ethernet_packet():
     try:
         from autotest.client.net import site_net_utils
         return site_net_utils.ethernet()
-    except Exception:
+    except ImportError:
         return ethernet()
-- 
1.8.1.4

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to