devices: disk: Handle unset source_protocol

This can't happen with libvirt processed XML, but could
be triggered via virt-install command line.

https://bugzilla.redhat.com/show_bug.cgi?id=1482636
This commit is contained in:
Cole Robinson 2019-06-16 11:01:47 -04:00
parent dcd0b2ac81
commit 52f0b1c91e

View File

@ -505,7 +505,7 @@ class DeviceDisk(Device):
self._set_source_network_from_url(self._storage_backend.get_path())
def _build_url_from_network_source(self):
ret = self.source_protocol
ret = self.source_protocol or "unknown"
if self.source_host_transport:
ret += "+%s" % self.source_host_transport
ret += "://"