35 lines
1.2 KiB
Diff
35 lines
1.2 KiB
Diff
|
Subject: sshtunnels: fix exception when the address is not an IP
|
||
|
From: Giuseppe Scrivano gscrivan@redhat.com Wed May 6 12:52:40 2015 +0200
|
||
|
Date: Wed May 6 21:27:50 2015 +0200:
|
||
|
Git: ebcb7c064ca5a3afd2ec3a0c8f59328a7f71b009
|
||
|
|
||
|
bug introduced with commit a2d453f3e20d103a4767394300c5183fde9a6bb4
|
||
|
|
||
|
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1218958
|
||
|
|
||
|
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
|
||
|
|
||
|
diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py
|
||
|
index 53f43be..03e1738 100644
|
||
|
--- a/virtManager/sshtunnels.py
|
||
|
+++ b/virtManager/sshtunnels.py
|
||
|
@@ -48,10 +48,16 @@ class ConnectionInfo(object):
|
||
|
self._connhost = "127.0.0.1"
|
||
|
|
||
|
def _is_listen_localhost(self, host=None):
|
||
|
- return ipaddr.IPNetwork(host or self.gaddr).is_loopback
|
||
|
+ try:
|
||
|
+ return ipaddr.IPNetwork(host or self.gaddr).is_loopback
|
||
|
+ except:
|
||
|
+ return False
|
||
|
|
||
|
def _is_listen_any(self):
|
||
|
- return ipaddr.IPNetwork(self.gaddr).is_unspecified
|
||
|
+ try:
|
||
|
+ return ipaddr.IPNetwork(self.gaddr).is_unspecified
|
||
|
+ except:
|
||
|
+ return False
|
||
|
|
||
|
def need_tunnel(self):
|
||
|
if not self._is_listen_localhost():
|