test if the path/file exists before mkdir

This commit is contained in:
Jianbin He
2007-09-10 15:40:22 +00:00
parent 52c94122e7
commit fefb93e6c3
+2 -1
View File
@@ -213,7 +213,8 @@ class JobWrapper( object ):
# Create the working directory
self.working_directory = \
os.path.join( self.app.config.job_working_directory, str( self.job_id ) )
os.mkdir( self.working_directory )
if not os.path.exists( self.working_directory ):
os.mkdir( self.working_directory )
# Restore parameters from the database
job = model.Job.get( self.job_id )
incoming = dict( [ ( p.name, p.value ) for p in job.parameters ] )