summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJF Ding <jian-feng.ding@intel.com>2011-10-21 13:32:26 +0800
committerJF Ding <jian-feng.ding@intel.com>2011-10-21 13:32:26 +0800
commit38811063a471c3d36be31f437d86a34af038f083 (patch)
tree11006b6d127653ae1610ebffdfeb506d78dd5e26
parent20ee81b73bf23eb85be58d92830a946e84ce2be5 (diff)
parentf97b1c33e1fcf2798341896c519f82afa7d7eb9f (diff)
downloadmic-38811063a471c3d36be31f437d86a34af038f083.tar.gz
mic-38811063a471c3d36be31f437d86a34af038f083.tar.bz2
mic-38811063a471c3d36be31f437d86a34af038f083.zip
Merge remote branch 'origin/master'
-rw-r--r--mic/utils/misc.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/mic/utils/misc.py b/mic/utils/misc.py
index b853c3f..cbf36ab 100644
--- a/mic/utils/misc.py
+++ b/mic/utils/misc.py
@@ -56,10 +56,9 @@ def save_ksconf_file(ksconf, release="latest", arch = "ia32", oldconf = None):
kscont.replace("@ARCH@", arch)
if kscont.find("/@BUILD_ID@/") != -1:
kscont = kscont.replace("@BUILD_ID@", release)
- ksconf = "/var/tmp/%s" % ksconf
- fd = open(ksconf, "w")
- fd.write(kscont)
- fd.close()
+ fd, ksconf = tempfile.mkstemp(prefix=os.path.basename(ksconf)+"-", dir="/var/tmp/mic/")
+ os.write(fd, kscont)
+ os.close(fd)
return ksconf