#NEWLINE# def validate_hosts( cli_hosts , config_path ) : #NEWLINE# #INDENT# if ( config_path is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# cli_host_set = set ( cli_hosts . split ( ',' ) ) #NEWLINE# if ( 'conf_hosts' in state . env ) : #NEWLINE# #INDENT# conf_hosts = set ( state . env . conf_hosts ) #NEWLINE# if ( not cli_host_set . issubset ( cli_hosts ) ) : #NEWLINE# #INDENT# raise ConfigurationError ( ( 'Hosts defined in --hosts/-H must be present in %s' % config_path ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise ConfigurationError ( ( 'Hosts cannot be defined with --hosts/-H when no hosts are listed in the configuration file %s. Correct the configuration file or run the command again without the --hosts or -H option.' % config_path ) )