Skip to content

Commit b814783

Browse files
Damodar ReddyAbhinandan Prateek
authored andcommitted
CLOUDSTACK-6298:[Windows] if already tmp directory exists inject keys is dailing on widows while starting the management server
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
1 parent 54d3a3d commit b814783

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎scripts/vm/systemvm/injectkeys.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@
3131
import commands
3232
import traceback
3333
import filecmp
34+
import tempfile
3435

3536
pathSep=os.sep
36-
TMP=os.path.expanduser("~") + os.sep + "tmp" #Get Home Directory
37+
TMP=tempfile.gettempdir() + os.sep + "tmp" #Get Home Directory
38+
print("Temp Directory is : %s" % TMP)
3739
MOUNTPATH=TMP + pathSep + "systemvm_mnt"
3840
TMPDIR=TMP + pathSep + "cloud" + pathSep + "systemvm"
3941
osType=os.name
@@ -81,7 +83,7 @@ def inject_into_iso(pubKey,systemiso):
8183
try :
8284
shutil.copytree(MOUNTPATH, TMPDIR)
8385
except :
84-
print ("Failed to copy from original iso %s" % isofile)
86+
print ("Failed to copy from original iso %s to %s" % (MOUNTPATH, TMPDIR))
8587
clean_up()
8688
sys.exit(IOError)
8789
try :

0 commit comments

Comments
 (0)