def parse_stats(conf, json):
 'Ignore stats if coming from non-leading mesos master'
 elected_result = lookup_stat('master/elected', json, conf)
 if (elected_result == 1):
  for (name, key) in get_stats_string(conf['version']).iteritems():
   result = lookup_stat(name, json, conf)
   dispatch_stat(result, name, key, conf)
 else:
  log_verbose(conf['verboseLogging'], 'This mesos master node is not elected leader so not writing data.')
  return None

def parse_stats ( conf , json ) : elected_result = lookup_stat ( 'master/elected' , json , conf ) if ( elected_result == 1 ) : for ( name , key ) in get_stats_string ( conf [ 'version' ] ) . iteritems ( ) : result = lookup_stat ( name , json , conf ) dispatch_stat ( result , name , key , conf ) else : log_verbose ( conf [ 'verboseLogging' ] , 'This mesos master node is not elected leader so not writing data.' ) return None
parse stats response from mesos slave .