Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 775b223

Browse files
committed
imagefetcher: Better error message for incorrect --location
1 parent 736d058 commit 775b223

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

virtinst/ImageFetcher.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ def _make_path(self, filename):
4444
else:
4545
path = self.location
4646

47-
if not path.endswith("/"):
48-
path += "/"
49-
path += filename
47+
if filename:
48+
if not path.endswith("/"):
49+
path += "/"
50+
path += filename
51+
5052
return path
5153

5254
def saveTemp(self, fileobj, prefix):

virtinst/OSDistro.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ def _storeForDistro(fetcher, baseuri, typ, progresscb, arch, distro=None,
106106
if store.isValidStore(fetcher, progresscb):
107107
return store
108108

109-
raise ValueError, _("Could not find an installable distribution at '%s'" %
110-
baseuri)
109+
raise ValueError(
110+
_("Could not find an installable distribution at '%s'\n"
111+
"The location must be the root directory of an install tree." %
112+
baseuri))
111113

112114
def _locationCheckWrapper(guest, baseuri, progresscb,
113115
scratchdir, _type, arch, callback):

0 commit comments

Comments
 (0)