summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2019-01-29 15:11:03 -0500
committerCole Robinson <crobinso@redhat.com>2019-02-03 12:05:18 -0500
commite1568e39a33c1a302f0c5dd11a45d9d823301b99 (patch)
tree6ea874ec065fe42b0ec0f89cc6badfc751c43b42
parent012a4e8ef5fdd259e6ff09e3001e25cca404f48a (diff)
downloadvirt-manager-e1568e39a33c1a302f0c5dd11a45d9d823301b99.tar.gz
urlfetcher: Simplify make_full_url
-rw-r--r--virtinst/urlfetcher.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index 5c380785..57ee42d6 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -32,8 +32,6 @@ class _URLFetcher(object):
self.scratchdir = scratchdir
self.meter = meter
- self._srcdir = None
-
logging.debug("Using scratchdir=%s", scratchdir)
@@ -46,13 +44,11 @@ class _URLFetcher(object):
Generate a full fetchable URL from the passed filename, which
is relative to the self.location
"""
- ret = self._srcdir or self.location
+ if self._is_iso:
+ return os.path.join("/", filename)
if not filename:
- return ret
-
- if not ret.endswith("/"):
- ret += "/"
- return ret + filename
+ return self.location
+ return os.path.join(self.location, filename)
def _grabURL(self, filename, fileobj):
"""
@@ -296,9 +292,6 @@ class _ISOURLFetcher(_URLFetcher):
_cache_file_list = None
_is_iso = True
- def _make_full_url(self, filename):
- return "/" + filename
-
def _grabber(self, url):
"""
Use isoinfo to grab the file