diff options
Diffstat (limited to 'src/virtManager')
-rw-r--r-- | src/virtManager/connection.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/virtManager/connection.py b/src/virtManager/connection.py index e26a85df..4c88931b 100644 --- a/src/virtManager/connection.py +++ b/src/virtManager/connection.py @@ -169,6 +169,17 @@ class vmmConnection(gobject.GObject): logging.warning("Unable to resolve local hostname for machine") return "localhost" + def get_hostname(self): + try: + (scheme, netloc, path, query, fragment) = self.uri_split() + + if netloc != "": + return netloc + except Exception, e: + logging.warning("Cannot parse URI %s: %s" % (self.uri, str(e))) + + return self.get_local_hostname() + def get_name(self): try: (scheme, netloc, path, query, fragment) = self.uri_split() |