#NEWLINE# def create_directory( path ) : #NEWLINE# #INDENT# if ( not os . path . isdir ( path ) ) : #NEWLINE# #INDENT# if os . path . exists ( path ) : #NEWLINE# #INDENT# raise RuntimeError ( '{0} is not a directory.' . format ( path ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# os . makedirs ( path , mode = 488 ) #NEWLINE# #UNINDENT# except OSError as error : #NEWLINE# #INDENT# logger . fatal ( 'failed to create {0}: {1}' . format ( path , error ) ) #NEWLINE# raise CouldNotCreateDbDir ( )