From b814783a636307bf73d359248ce33d541f534fda Mon Sep 17 00:00:00 2001 From: Damodar Reddy Date: Tue, 15 Apr 2014 15:19:15 +0530 Subject: [PATCH] CLOUDSTACK-6298:[Windows] if already tmp directory exists inject keys is dailing on widows while starting the management server Signed-off-by: Abhinandan Prateek --- scripts/vm/systemvm/injectkeys.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/vm/systemvm/injectkeys.py b/scripts/vm/systemvm/injectkeys.py index bd840f98e78..08922550360 100644 --- a/scripts/vm/systemvm/injectkeys.py +++ b/scripts/vm/systemvm/injectkeys.py @@ -31,9 +31,11 @@ import subprocess import commands import traceback import filecmp +import tempfile pathSep=os.sep -TMP=os.path.expanduser("~") + os.sep + "tmp" #Get Home Directory +TMP=tempfile.gettempdir() + os.sep + "tmp" #Get Home Directory +print("Temp Directory is : %s" % TMP) MOUNTPATH=TMP + pathSep + "systemvm_mnt" TMPDIR=TMP + pathSep + "cloud" + pathSep + "systemvm" osType=os.name @@ -81,7 +83,7 @@ def inject_into_iso(pubKey,systemiso): try : shutil.copytree(MOUNTPATH, TMPDIR) except : - print ("Failed to copy from original iso %s" % isofile) + print ("Failed to copy from original iso %s to %s" % (MOUNTPATH, TMPDIR)) clean_up() sys.exit(IOError) try :