connection: Fix transport detection for qemu://$HOST/system

In this case, when a host is specified but not a transport, libvirt
defaults to transport=tls
This commit is contained in:
Cole Robinson 2016-06-21 11:31:26 -04:00
parent e69cc002b1
commit c5ce0ab512

View File

@ -355,6 +355,10 @@ class VirtualConnection(object):
def get_uri_username(self):
return self._uriobj.username
def get_uri_transport(self):
if self.get_uri_hostname() and not self._uriobj.transport:
# Libvirt defaults to transport=tls if hostname specified but
# no transport is specified
return "tls"
return self._uriobj.transport
def get_uri_path(self):
return self._uriobj.path