Commit 2b12660d by Kálmán Viktor

vm: fix Instance.get_connect_host method temporarily

parent 54c5f067
...@@ -502,10 +502,11 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -502,10 +502,11 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
def get_connect_host(self, use_ipv6=False): def get_connect_host(self, use_ipv6=False):
"""Get public hostname. """Get public hostname.
""" """
if not self.firewall_host: if not self.interface_set.exclude(host=None):
return _('None') return _('None')
proto = 'ipv6' if use_ipv6 else 'ipv4' proto = 'ipv6' if use_ipv6 else 'ipv4'
return self.firewall_host.get_hostname(proto=proto) return self.interface_set.exclude(host=None)[0].host.get_hostname(
def get_connect_uri(self, use_ipv6=False): def get_connect_uri(self, use_ipv6=False):
"""Get access parameters in URI format. """Get access parameters in URI format.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment