[virt-manager PATCH] interface: don't print error for active interface without an IP address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If there is no IP address for active interface we need to skip
probing it.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1449509

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 virtManager/interface.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/virtManager/interface.py b/virtManager/interface.py
index 2fe61b2a..ce1c1eba 100644
--- a/virtManager/interface.py
+++ b/virtManager/interface.py
@@ -138,13 +138,14 @@ class vmmInterface(vmmLibvirtObject):
             return None, []
 
         ret = []
-        for ip in activeProto.ips:
-            ipstr = ip.address
-            if not ipstr:
-                continue
-            if ip.prefix:
-                ipstr += "/%s" % ip.prefix
-            ret.append(ipstr)
+        if activeProto:
+            for ip in activeProto.ips:
+                ipstr = ip.address
+                if not ipstr:
+                    continue
+                if ip.prefix:
+                    ipstr += "/%s" % ip.prefix
+                ret.append(ipstr)
         return inactiveProto or activeProto, ret
 
     def get_ipv4(self):
-- 
2.12.2

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux