Re-add get_hostname method - needed for host details page

This commit is contained in:
Daniel P. Berrange 2007-07-14 17:58:23 -04:00
parent e23cb027a4
commit 5827abcc1f

View File

@ -169,6 +169,17 @@ class vmmConnection(gobject.GObject):
logging.warning("Unable to resolve local hostname for machine") logging.warning("Unable to resolve local hostname for machine")
return "localhost" 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): def get_name(self):
try: try:
(scheme, netloc, path, query, fragment) = self.uri_split() (scheme, netloc, path, query, fragment) = self.uri_split()