def get_node_zones():
 try:
  file = open(buddyinfo_file, 'r')
 except IOError:
  return 0
 metrics = {}
 for line in file:
  metrics = re.split('\\s+', line)
  node_id = metrics[1].replace(',', '')
  zone = metrics[3].lower()
  zones.append(((('node' + node_id) + '_') + zone))

def get_node_zones ( ) : try : file = open ( buddyinfo_file , 'r' ) except IOError : return 0 metrics = { } for line in file : metrics = re . split ( '\\s+' , line ) node_id = metrics [ 1 ] . replace ( ',' , '' ) zone = metrics [ 3 ] . lower ( ) zones . append ( ( ( ( 'node' + node_id ) + '_' ) + zone ) )
return all zones metrics .