Blame SOURCES/virt-manager-interface-don-t-print-error-for-active-interface-wit.patch

184e0d
From bc0fe89315ac2f2a7a68d2d19df9a6a17a575fee Mon Sep 17 00:00:00 2001
184e0d
From: Pavel Hrdina <phrdina@redhat.com>
184e0d
Date: Wed, 10 May 2017 10:00:39 +0200
184e0d
Subject: interface: don't print error for active interface without an IP
184e0d
 address
184e0d
184e0d
If there is no IP address for active interface we need to skip
184e0d
probing it.
184e0d
184e0d
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1449509
184e0d
184e0d
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
184e0d
(cherry picked from commit 86e2c23d71a1bdaa153a578e98bf91d47a045f36)
184e0d
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
184e0d
---
184e0d
 virtManager/interface.py | 15 ++++++++-------
184e0d
 1 file changed, 8 insertions(+), 7 deletions(-)
184e0d
184e0d
diff --git a/virtManager/interface.py b/virtManager/interface.py
184e0d
index 2fe61b2a..ce1c1eba 100644
184e0d
--- a/virtManager/interface.py
184e0d
+++ b/virtManager/interface.py
184e0d
@@ -138,13 +138,14 @@ class vmmInterface(vmmLibvirtObject):
184e0d
             return None, []
184e0d
 
184e0d
         ret = []
184e0d
-        for ip in activeProto.ips:
184e0d
-            ipstr = ip.address
184e0d
-            if not ipstr:
184e0d
-                continue
184e0d
-            if ip.prefix:
184e0d
-                ipstr += "/%s" % ip.prefix
184e0d
-            ret.append(ipstr)
184e0d
+        if activeProto:
184e0d
+            for ip in activeProto.ips:
184e0d
+                ipstr = ip.address
184e0d
+                if not ipstr:
184e0d
+                    continue
184e0d
+                if ip.prefix:
184e0d
+                    ipstr += "/%s" % ip.prefix
184e0d
+                ret.append(ipstr)
184e0d
         return inactiveProto or activeProto, ret
184e0d
 
184e0d
     def get_ipv4(self):
184e0d
-- 
184e0d
2.13.0
184e0d