Skip to content

Commit cbf4f2f

Browse files
committed
cPanel Importer: Cater domains outside document root
1 parent eefaf46 commit cbf4f2f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

plogical/cPanelImporter.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,15 @@ def CreateChildDomains(self):
440440
movePath = '%s/homedir/public_html/%s' % (
441441
CompletPathToExtractedArchive, ChildDocRoot.replace(self.documentRoot, '', 1).replace('/', ''))
442442

443-
shutil.move(movePath, path)
443+
print movePath
444+
445+
if os.path.exists(movePath):
446+
shutil.move(movePath, path)
447+
else:
448+
movePath = '%s/homedir/%s' % (
449+
CompletPathToExtractedArchive, ChildDocRoot.split('/')[-1].replace(self.documentRoot, '', 1).replace('/', ''))
450+
print movePath
451+
shutil.move(movePath, path)
444452

445453
command = 'chown -R %s:%s %s' % (externalApp, externalApp, path)
446454
ProcessUtilities.normalExecutioner(command)

0 commit comments

Comments
 (0)