Fix for a same bug mentioned in last commit

This commit is contained in:
Miroslav Stampar 2014-02-16 21:47:14 +01:00
parent 43df4efd11
commit dfa727cbc5

View File

@ -262,9 +262,9 @@ class Web:
uplPage, _, _ = Request.getPage(url=self.webStagerUrl, direct=True, raise404=False) uplPage, _, _ = Request.getPage(url=self.webStagerUrl, direct=True, raise404=False)
uplPage = uplPage or "" uplPage = uplPage or ""
for x in list(re.finditer('/', directory)): for match in re.finditer('/', directory):
self.webBaseUrl = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, directory[x.start():]) self.webBaseUrl = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, directory[match.start():])
self.webStagerUrl = os.path.join(self.webBaseUrl, stagerName) self.webStagerUrl = urlparse.urljoin(self.webBaseUrl, stagerName)
self.webStagerFilePath = ntToPosixSlashes(os.path.join(directory, stagerName)) self.webStagerFilePath = ntToPosixSlashes(os.path.join(directory, stagerName))
debugMsg = "trying to see if the file is accessible from %s" % self.webStagerUrl debugMsg = "trying to see if the file is accessible from %s" % self.webStagerUrl
@ -279,7 +279,7 @@ class Web:
if not uploaded: if not uploaded:
self.webBaseUrl = "%s://%s:%d/" % (conf.scheme, conf.hostname, conf.port) self.webBaseUrl = "%s://%s:%d/" % (conf.scheme, conf.hostname, conf.port)
self.webStagerUrl = os.path.join(self.webBaseUrl, stagerName) self.webStagerUrl = urlparse.urljoin(self.webBaseUrl, stagerName)
self.webStagerFilePath = ntToPosixSlashes(os.path.join(directory, stagerName)) self.webStagerFilePath = ntToPosixSlashes(os.path.join(directory, stagerName))
debugMsg = "trying to see if the file is accessible from %s" % self.webStagerUrl debugMsg = "trying to see if the file is accessible from %s" % self.webStagerUrl