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