<s> import logging <EOL> import logging . config <EOL> from helion_configurationprocessor . cp . model . ValidatorPlugin import ValidatorPlugin <EOL> from helion_configurationprocessor . cp . model . CPLogging import CPLogging as KenLog <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class ServerGroupsValidator ( ValidatorPlugin ) : <EOL> def __init__ ( self , instructions , config_files ) : <EOL> super ( ServerGroupsValidator , self ) . __init__ ( <EOL> <NUM_LIT> , instructions , config_files , <EOL> '<STR_LIT>' ) <EOL> self . _valid = False <EOL> LOG . info ( '<STR_LIT>' % KenLog . fcn ( ) ) <EOL> def validate ( self ) : <EOL> LOG . info ( '<STR_LIT>' % KenLog . fcn ( ) ) <EOL> version = float ( self . version ( ) ) <EOL> input = self . _create_content ( version , "<STR_LIT>" ) <EOL> if not input : <EOL> return True <EOL> self . _valid = self . validate_schema ( input , "<STR_LIT>" ) <EOL> if self . _valid : <EOL> server_groups = input [ '<STR_LIT>' ] <EOL> self . _validate_names ( server_groups ) <EOL> return self . _valid <EOL> def _validate_names ( self , server_groups ) : <EOL> names = set ( ) <EOL> for group in server_groups : <EOL> if group [ '<STR_LIT:name>' ] in names : <EOL> msg = ( "<STR_LIT>" % <EOL> ( group [ '<STR_LIT:name>' ] ) ) <EOL> self . add_error ( msg ) <EOL> self . valid = False <EOL> else : <EOL> names . add ( group [ '<STR_LIT:name>' ] ) <EOL> @ property <EOL> def instructions ( self ) : <EOL> return self . _instructions <EOL> def get_dependencies ( self ) : <EOL> return [ ] </s>
