#NEWLINE# def _parse_ips_from_nic( self , nic ) : #NEWLINE# #INDENT# '\n        Parse private and public IP addresses from the provided network\n        interface object.\n\n        :param nic: NIC object.\n        :type nic: ``dict``\n\n        :return: (public_ips, private_ips) tuple.\n        :rtype: ``tuple``\n        ' #NEWLINE# ( public_ips , private_ips ) = ( [ ] , [ ] ) #NEWLINE# ipv4_conf = nic [ 'ip_v4_conf' ] #NEWLINE# ipv6_conf = nic [ 'ip_v6_conf' ] #NEWLINE# ip_v4 = ( ipv4_conf [ 'ip' ] if ipv4_conf else None ) #NEWLINE# ip_v6 = ( ipv6_conf [ 'ip' ] if ipv6_conf else None ) #NEWLINE# ipv4 = ( ip_v4 [ 'uuid' ] if ip_v4 else None ) #NEWLINE# ipv6 = ( ip_v4 [ 'uuid' ] if ip_v6 else None ) #NEWLINE# ips = [ ] #NEWLINE# if ipv4 : #NEWLINE# #INDENT# ips . append ( ipv4 ) #NEWLINE# #UNINDENT# if ipv6 : #NEWLINE# #INDENT# ips . append ( ipv6 ) #NEWLINE# #UNINDENT# runtime = nic [ 'runtime' ] #NEWLINE# ip_v4 = ( runtime [ 'ip_v4' ] if nic [ 'runtime' ] else None ) #NEWLINE# ip_v6 = ( runtime [ 'ip_v6' ] if nic [ 'runtime' ] else None ) #NEWLINE# ipv4 = ( ip_v4 [ 'uuid' ] if ip_v4 else None ) #NEWLINE# ipv6 = ( ip_v4 [ 'uuid' ] if ip_v6 else None ) #NEWLINE# if ipv4 : #NEWLINE# #INDENT# ips . append ( ipv4 ) #NEWLINE# #UNINDENT# if ipv6 : #NEWLINE# #INDENT# ips . append ( ipv6 ) #NEWLINE# #UNINDENT# ips = set ( ips ) #NEWLINE# for ip in ips : #NEWLINE# #INDENT# if is_private_subnet ( ip ) : #NEWLINE# #INDENT# private_ips . append ( ip ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# public_ips . append ( ip ) #NEWLINE# #UNINDENT# #UNINDENT# return ( public_ips , private_ips )