#NEWLINE# def _to_node( self , el ) : #NEWLINE# #INDENT# def get_ips( el ) : #NEWLINE# #INDENT# return [ ip . get ( 'addr' ) for ip in el ] #NEWLINE# #UNINDENT# def get_meta_dict( el ) : #NEWLINE# #INDENT# d = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for meta in el : #NEWLINE# #INDENT# d [ meta . get ( 'key' ) ] = meta . text #NEWLINE# #UNINDENT# return d #NEWLINE# #UNINDENT# public_ip = get_ips ( self . _findall ( el , 'addresses/public/ip' ) ) #NEWLINE# private_ip = get_ips ( self . _findall ( el , 'addresses/private/ip' ) ) #NEWLINE# metadata = get_meta_dict ( self . _findall ( el , 'metadata/meta' ) ) #NEWLINE# n = Node ( id = el . get ( 'id' ) , name = el . get ( 'name' ) , state = self . NODE_STATE_MAP . get ( el . get ( 'status' ) , NodeState . UNKNOWN ) , public_ip = public_ip , private_ip = private_ip , driver = self . connection . driver , extra = { #NEWLINE# #INDENT# 'password' : el . get ( 'adminPass' ) , #NEWLINE# 'hostId' : el . get ( 'hostId' ) , #NEWLINE# 'imageId' : el . get ( 'imageId' ) , #NEWLINE# 'flavorId' : el . get ( 'flavorId' ) , #NEWLINE# 'uri' : ( 'https://%s%s/servers/%s' % ( self . connection . host , self . connection . request_path , el . get ( 'id' ) ) ) , #NEWLINE# 'metadata' : metadata , #NEWLINE# #UNINDENT# } ) #NEWLINE# return n