[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[et-mgmt-tools] [PATCH] virtinst: create scratchdir if it doesn't exisst



Hi,
subject basically says it all. Please apply if you see fit.
 -- Guido
# HG changeset patch
# User Guido Guenther <agx sigxcpu org>
# Date 1222081640 -7200
# Node ID 1c780d8897653af0f13008954e7ecff9f8fdd724
# Parent  96686d6e460a7763ef431362f45a0a28e66edf22
create scratchdir if it doesn't exist

diff -r 96686d6e460a -r 1c780d889765 virtinst/ImageFetcher.py
--- a/virtinst/ImageFetcher.py	Mon Sep 22 13:07:04 2008 +0200
+++ b/virtinst/ImageFetcher.py	Mon Sep 22 13:07:20 2008 +0200
@@ -40,6 +40,8 @@
         self.scratchdir = scratchdir
 
     def saveTemp(self, fileobj, prefix):
+        if not os.path.exists(self.scratchdir):
+            os.makedirs(self.scratchdir, 0750)
         (fd, fn) = tempfile.mkstemp(prefix="virtinst-" + prefix, dir=self.scratchdir)
         block_size = 16384
         try:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]