virt-install: Fix --location nfs:// (bz 1011177)

This commit is contained in:
Cole Robinson 2013-09-23 21:23:36 -04:00
parent 827e4cd9e5
commit 8ba600a8e7
2 changed files with 5 additions and 3 deletions

View File

@ -404,9 +404,8 @@ class DistroInstaller(Installer):
is_local = not self.conn.is_remote()
if _is_url(val, is_local):
self._location_is_path = False
self._location = _sanitize_url(val)
logging.debug("DistroInstaller location is a network source.")
return val
return _sanitize_url(val)
try:
d = self._make_cdrom_dev(val)

View File

@ -208,6 +208,9 @@ class _MountedImageFetcher(_LocalImageFetcher):
else:
mountopt = "ro,loop"
cmd = [mountcmd, "-o", mountopt, self.location, self.srcdir]
logging.debug("mount cmd: %s", cmd)
ret = subprocess.call(cmd)
if ret != 0:
self.cleanupLocation()
@ -235,7 +238,7 @@ def _fetcherForURI(uri, scratchdir=None):
fclass = _HTTPImageFetcher
elif uri.startswith("ftp://"):
fclass = _FTPImageFetcher
elif uri.startswith("nfs://"):
elif uri.startswith("nfs:"):
fclass = _MountedImageFetcher
else:
if os.path.isdir(uri):