#NEWLINE# def conditional_mkdir( path , group = None , mode = None , user = None , use_local = False , use_sudo = False ) : #NEWLINE# #INDENT# cmd = ( 'mkdir -p %s' % path ) #NEWLINE# if ( not exists ( path ) ) : #NEWLINE# #INDENT# if use_local : #NEWLINE# #INDENT# local ( cmd ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# _conditional_sudo ( cmd , use_sudo ) #NEWLINE# #UNINDENT# #UNINDENT# if group : #NEWLINE# #INDENT# chgrp ( path , group , use_sudo = True ) #NEWLINE# #UNINDENT# if user : #NEWLINE# #INDENT# chown ( path , user , use_sudo = True ) #NEWLINE# #UNINDENT# if mode : #NEWLINE# #INDENT# chmod ( path , mode , use_sudo = True )