From 818c9787b25f808519b47d2f48b4bb3e5f2f2d80 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 23 Jan 2011 21:20:16 +0000 Subject: [PATCH] minor update --- lib/takeover/web.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/takeover/web.py b/lib/takeover/web.py index 7882c110f..fe6a193e0 100644 --- a/lib/takeover/web.py +++ b/lib/takeover/web.py @@ -213,12 +213,21 @@ class Web: localPath = directory uriPath = directory[2:] if isWindowsDriveLetterPath(directory) else directory docRoot = docRoot[2:] if isWindowsDriveLetterPath(docRoot) else docRoot - uriPath = uriPath.replace(docRoot, "/") - uriPath = "/%s" % normalizePath(uriPath) - uriPath = uriPath.replace("//", "/") + if docRoot in uriPath: + uriPath = uriPath.replace(docRoot, "/") + uriPath = "/%s" % normalizePath(uriPath) + else: + webDir = extractRegexResult(r"//[^/]+?/(?P.*)/.", conf.url) + if webDir: + uriPath = "/%s" % webDir + else: + continue + uriPath = uriPath.replace("//", "/").rstrip('/') localPath = localPath.rstrip('/') - uriPath = uriPath.rstrip('/') + + if not uriPath: + uriPath = '/' # Upload the file stager self.__webFileInject(stagerContent, stagerName, localPath)