#NEWLINE# @ classmethod #NEWLINE# def check_roles_for_conflicts( cls , roles , roles_metadata ) : #NEWLINE# #INDENT# all_roles = set ( roles_metadata . keys ( ) ) #NEWLINE# for role in roles : #NEWLINE# #INDENT# if ( 'conflicts' in roles_metadata [ role ] ) : #NEWLINE# #INDENT# other_roles = ( roles - set ( [ role ] ) ) #NEWLINE# conflicting_roles = roles_metadata [ role ] [ 'conflicts' ] #NEWLINE# if ( conflicting_roles == '*' ) : #NEWLINE# #INDENT# conflicting_roles = ( all_roles - set ( [ role ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# conflicting_roles = set ( conflicting_roles ) #NEWLINE# #UNINDENT# conflicting_roles &= other_roles #NEWLINE# if conflicting_roles : #NEWLINE# #INDENT# raise errors . InvalidData ( 'Role "{0}" in conflict with role {1}' . format ( role , ', ' . join ( roles ) ) , log_message = True )