Ran into another bug where a file is written to without checking
if the directory already exists. I ran into this because my test
had some errors in it, which is probably why it hasn't been caught yet.
Signed-off-by: Scott Zawalski <scottz@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1185 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/server_job.py b/server/server_job.py
index eaf4e3d..ae92172 100755
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -348,5 +348,8 @@
print msg
open(status_file, "a").write(self.record_prefix + msg + "\n")
if subdir:
- status_file = os.path.join(self.resultdir, subdir, 'status')
+ test_dir = os.path.join(self.resultdir, subdir)
+ if not os.path.exists(test_dir):
+ os.mkdir(test_dir)
+ status_file = os.path.join(test_dir, 'status')
open(status_file, "a").write(msg + "\n")