mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Update network parser to add private ips to array
Previously the network parser would overwrite the private ip addresses if there were more than one. These are now added to an array
This commit is contained in:
parent
cd889b8297
commit
fc8285903f
1 changed files with 16 additions and 0 deletions
|
@ -11,6 +11,7 @@ module Fog
|
|||
@in_group_set = false
|
||||
@in_attachment = false
|
||||
@in_association = false
|
||||
@in_private_ip_addresses = false
|
||||
end
|
||||
|
||||
def reset
|
||||
|
@ -32,6 +33,10 @@ module Fog
|
|||
when 'association'
|
||||
@in_association = true
|
||||
@association = {}
|
||||
when 'privateIpAddressesSet'
|
||||
@in_private_ip_addresses = true
|
||||
@private_ip_addresses = []
|
||||
@private_ip_address = {}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -72,6 +77,17 @@ module Fog
|
|||
@nic['association'] = @association
|
||||
@in_association = false
|
||||
end
|
||||
elsif @in_private_ip_addresses
|
||||
case name
|
||||
when 'item'
|
||||
@private_ip_addresses << @private_ip_address
|
||||
@private_ip_address = {}
|
||||
when 'privateIpAddress', 'privateDnsName', 'primary'
|
||||
@private_ip_address[name] = value
|
||||
when 'privateIpAddressesSet'
|
||||
@nic['privateIpAddresses'] = @private_ip_addresses
|
||||
@in_private_ip_address = false
|
||||
end
|
||||
else
|
||||
case name
|
||||
when 'networkInterfaceId', 'subnetId', 'vpcId', 'availabilityZone', 'description', 'ownerId', 'requesterId',
|
||||
|
|
Loading…
Reference in a new issue