Skip to content

Commit

Permalink
Merge pull request #1 from Shopify/address_list
Browse files Browse the repository at this point in the history
fix address list
  • Loading branch information
PeiwenChen committed Mar 30, 2016
2 parents 0d1ecb1 + d7fbbd0 commit 36907eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/junos-ez/ip_ports/classic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ def xml_read_parser( as_xml, as_hash )
xml_when_item(as_xml.xpath('description')){ |i| as_hash[:description] = i.text }
xml_when_item(ifa_inet.xpath('mtu')){ |i| as_hash[:mtu] = i.text.to_i }

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

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

0 comments on commit 36907eb

Please sign in to comment.