#NEWLINE# def _show_normalized_node( full_node ) : #NEWLINE# #INDENT# '\n    Normalize the QingCloud instance data. Used by list_nodes()-related\n    functions.\n    ' #NEWLINE# public_ips = full_node . get ( 'eip' , [ ] ) #NEWLINE# if public_ips : #NEWLINE# #INDENT# public_ip = public_ips [ 'eip_addr' ] #NEWLINE# public_ips = [ public_ip ] #NEWLINE# #UNINDENT# private_ips = [ ] #NEWLINE# for vxnet in full_node . get ( 'vxnets' , [ ] ) : #NEWLINE# #INDENT# private_ip = vxnet . get ( 'private_ip' , None ) #NEWLINE# if private_ip : #NEWLINE# #INDENT# private_ips . append ( private_ip ) #NEWLINE# #UNINDENT# #UNINDENT# normalized_node = { #NEWLINE# #INDENT# 'id' : full_node [ 'instance_id' ] , #NEWLINE# 'image' : full_node [ 'image' ] [ 'image_id' ] , #NEWLINE# 'size' : full_node [ 'instance_type' ] , #NEWLINE# 'state' : full_node [ 'status' ] , #NEWLINE# 'private_ips' : private_ips , #NEWLINE# 'public_ips' : public_ips , #NEWLINE# #UNINDENT# } #NEWLINE# return normalized_node