def _validate_privileges(object_type, privs, privileges):
 if (object_type != 'group'):
  _perms = [_PRIVILEGES_MAP[perm] for perm in _PRIVILEGE_TYPE_MAP[object_type]]
  _perms.append('ALL')
  if (object_type not in _PRIVILEGES_OBJECTS):
   raise SaltInvocationError('Invalid object_type: {0} provided'.format(object_type))
  if (not set(privs).issubset(set(_perms))):
   raise SaltInvocationError('Invalid privilege(s): {0} provided for object {1}'.format(privileges, object_type))
 elif privileges:
  raise SaltInvocationError('The privileges option should not be set for object_type group')

def _validate_privileges ( object_type , privs , privileges ) : if ( object_type != 'group' ) : _perms = [ _PRIVILEGES_MAP [ perm ] for perm in _PRIVILEGE_TYPE_MAP [ object_type ] ] _perms . append ( 'ALL' ) if ( object_type not in _PRIVILEGES_OBJECTS ) : raise SaltInvocationError ( 'Invalid object_type: {0} provided' . format ( object_type ) ) if ( not set ( privs ) . issubset ( set ( _perms ) ) ) : raise SaltInvocationError ( 'Invalid privilege(s): {0} provided for object {1}' . format ( privileges , object_type ) ) elif privileges : raise SaltInvocationError ( 'The privileges option should not be set for object_type group' )
validate the supplied privileges .