def peer_status():
 root = _gluster_xml('peer status')
 if (not _gluster_ok(root)):
  return None
 result = {}
 for peer in _iter(root, 'peer'):
  uuid = peer.find('uuid').text
  result[uuid] = {'hostnames': []}
  for item in peer:
   if (item.tag == 'hostname'):
    result[uuid]['hostnames'].append(item.text)
   elif (item.tag == 'hostnames'):
    for hostname in item:
     if (hostname.text not in result[uuid]['hostnames']):
      result[uuid]['hostnames'].append(hostname.text)
   elif (item.tag != 'uuid'):
    result[uuid][item.tag] = item.text
 return result

def peer_status ( ) : root = _gluster_xml ( 'peer status' ) if ( not _gluster_ok ( root ) ) : return None result = { } for peer in _iter ( root , 'peer' ) : uuid = peer . find ( 'uuid' ) . text result [ uuid ] = { 'hostnames' : [ ] } for item in peer : if ( item . tag == 'hostname' ) : result [ uuid ] [ 'hostnames' ] . append ( item . text ) elif ( item . tag == 'hostnames' ) : for hostname in item : if ( hostname . text not in result [ uuid ] [ 'hostnames' ] ) : result [ uuid ] [ 'hostnames' ] . append ( hostname . text ) elif ( item . tag != 'uuid' ) : result [ uuid ] [ item . tag ] = item . text return result
return peer status information the return value is a dictionary with peer uuids as keys and dicts of peer information as values .