def mkdir(path, owner=None, grant_perms=None, deny_perms=None, inheritance=True):
 drive = os.path.splitdrive(path)[0]
 if (not os.path.isdir(drive)):
  raise CommandExecutionError('Drive {0} is not mapped'.format(drive))
 path = os.path.expanduser(path)
 path = os.path.expandvars(path)
 if (not os.path.isdir(path)):
  os.mkdir(path)
  if owner:
   salt.utils.win_dacl.set_owner(path, owner)
  set_perms(path, grant_perms, deny_perms, inheritance)
 return True

def mkdir ( path , owner = None , grant_perms = None , deny_perms = None , inheritance = True ) : drive = os . path . splitdrive ( path ) [ 0 ] if ( not os . path . isdir ( drive ) ) : raise CommandExecutionError ( 'Drive {0} is not mapped' . format ( drive ) ) path = os . path . expanduser ( path ) path = os . path . expandvars ( path ) if ( not os . path . isdir ( path ) ) : os . mkdir ( path ) if owner : salt . utils . win_dacl . set_owner ( path , owner ) set_perms ( path , grant_perms , deny_perms , inheritance ) return True
insure the dir exist and mode ok .