def chpgrp(path, group):
 if (group is None):
  raise SaltInvocationError("The group value was specified as None and is invalid. If you mean the built-in None group, specify the group in lowercase, e.g. 'none'.")
 err = ''
 try:
  (groupSID, domainName, objectType) = win32security.LookupAccountName(None, group)
 except pywinerror:
  err += 'Group does not exist\n'
 if (not os.path.exists(path)):
  err += 'File not found\n'
 if err:
  return err
 privilege_enabled = False
 try:
  privilege_enabled = _enable_privilege(win32security.SE_RESTORE_NAME)
  win32security.SetNamedSecurityInfo(path, win32security.SE_FILE_OBJECT, win32security.GROUP_SECURITY_INFORMATION, None, groupSID, None, None)
 finally:
  if privilege_enabled:
   _disable_privilege(win32security.SE_RESTORE_NAME)
 return None

def chpgrp ( path , group ) : if ( group is None ) : raise SaltInvocationError ( "The group value was specified as None and is invalid. If you mean the built-in None group, specify the group in lowercase, e.g. 'none'." ) err = '' try : ( groupSID , domainName , objectType ) = win32security . LookupAccountName ( None , group ) except pywinerror : err += 'Group does not exist\n' if ( not os . path . exists ( path ) ) : err += 'File not found\n' if err : return err privilege_enabled = False try : privilege_enabled = _enable_privilege ( win32security . SE_RESTORE_NAME ) win32security . SetNamedSecurityInfo ( path , win32security . SE_FILE_OBJECT , win32security . GROUP_SECURITY_INFORMATION , None , groupSID , None , None ) finally : if privilege_enabled : _disable_privilege ( win32security . SE_RESTORE_NAME ) return None
change the group of a file under windows .