#NEWLINE# def _to_node( self , obj ) : #NEWLINE# #INDENT# lid = obj [ 'LINODEID' ] #NEWLINE# params = { #NEWLINE# #INDENT# 'api_action' : 'linode.ip.list' , #NEWLINE# 'LinodeID' : lid , #NEWLINE# #UNINDENT# } #NEWLINE# req = self . connection . request ( LINODE_ROOT , params = params ) #NEWLINE# if ( ( not req . success ( ) ) or ( len ( req . object ) == 0 ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# public_ip = private_ip = None #NEWLINE# for ip in req . object : #NEWLINE# #INDENT# if ip [ 'ISPUBLIC' ] : #NEWLINE# #INDENT# public_ip = ip [ 'IPADDRESS' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# private_ip = ip [ 'IPADDRESS' ] #NEWLINE# #UNINDENT# #UNINDENT# n = Node ( id = lid , name = obj [ 'LABEL' ] , state = self . LINODE_STATES [ obj [ 'STATUS' ] ] , public_ip = public_ip , private_ip = private_ip , driver = self . connection . driver ) #NEWLINE# n . extra = copy ( req ) #NEWLINE# return n