#NEWLINE# def lookup_in_config( config_key , config_file , host ) : #NEWLINE# #INDENT# with settings ( hide ( 'stdout' , 'warnings' , 'aborts' ) ) : #NEWLINE# #INDENT# config_value = execute ( sudo , ( 'grep %s= %s' % ( config_key , config_key ) ) , user = 'presto' , group = 'presto' , warn_only = True , host = host ) [ host ] #NEWLINE# #UNINDENT# if ( isinstance ( config_value , Exception ) or ( config_value . return_code == 2 ) ) : #NEWLINE# #INDENT# raise ConfigurationError ( ( 'Configuration file %s does not exist on host %s' % ( config_file , host ) ) ) #NEWLINE# #UNINDENT# return config_value