def get_interfaces_ip(self):
interfaces_ip = {}<EOL>interface_table = junos_views.junos_ip_interfaces_table(self.device)<EOL>interface_table.get()<EOL>interface_table_items = interface_table.items()<EOL>_FAMILY_VMAP_ = {<EOL>'<STR_LIT>': u'<STR_LIT>',<EOL>'<STR_LIT>': u'<STR_LIT>'<EOL>}<EOL>_FAMILY_MAX_PREFIXLEN = {<EOL>'<STR_LIT>': <NUM_LIT:32>,<EOL>'<STR_LIT>': <NUM_LIT><EOL>}<EOL>for interface_details in interface_table_items:<EOL><INDENT>ip_network = interface_details[<NUM_LIT:0>]<EOL>ip_address = ip_network.split('<STR_LIT:/>')[<NUM_LIT:0>]<EOL>address = napalm_base.helpers.convert(<EOL>napalm_base.helpers.ip, ip_address, ip_address)<EOL>try:<EOL><INDENT>interface_details_dict = dict(interface_details[<NUM_LIT:1>])<EOL>family_raw = interface_details_dict.get('<STR_LIT>')<EOL>interface = py23_compat.text_type(interface_details_dict.get('<STR_LIT>'))<EOL><DEDENT>except ValueError:<EOL><INDENT>continue<EOL><DEDENT>prefix = napalm_base.helpers.convert(int,<EOL>ip_network.split('<STR_LIT:/>')[-<NUM_LIT:1>],<EOL>_FAMILY_MAX_PREFIXLEN.get(family_raw))<EOL>family = _FAMILY_VMAP_.get(family_raw)<EOL>if not family or not interface:<EOL><INDENT>continue<EOL><DEDENT>if interface not in interfaces_ip.keys():<EOL><INDENT>interfaces_ip[interface] = {}<EOL><DEDENT>if family not in interfaces_ip[interface].keys():<EOL><INDENT>interfaces_ip[interface][family] = {}<EOL><DEDENT>if address not in interfaces_ip[interface][family].keys():<EOL><INDENT>interfaces_ip[interface][family][address] = {}<EOL><DEDENT>interfaces_ip[interface][family][address][u'<STR_LIT>'] = prefix<EOL><DEDENT>return interfaces_ip<EOL>
Return the configured IP addresses.