Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit d7fbbd0

Browse files
committed
fix address list
1 parent 0d1ecb1 commit d7fbbd0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/junos-ez/ip_ports/classic.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ def xml_read_parser( as_xml, as_hash )
5151
xml_when_item(as_xml.xpath('description')){ |i| as_hash[:description] = i.text }
5252
xml_when_item(ifa_inet.xpath('mtu')){ |i| as_hash[:mtu] = i.text.to_i }
5353

54-
# @@@ assuming a single IP address; prolly need to be more specific ...
55-
as_hash[:address] = ifa_inet.xpath('address/name').text || nil
54+
# The address could be a list.
55+
address = []
56+
ifa_inet.xpath('address').each do |addr|
57+
address << addr.xpath('name').text
58+
end
59+
as_hash[:address] = address || nil
5660

5761
# check for firewall-filters (aka ACLs)
5862
if (fw_acl = ifa_inet.xpath('filter')[0])

0 commit comments

Comments
 (0)