mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
fix security group stuff for instances
This commit is contained in:
parent
47c53e06b0
commit
0fe074dae1
2 changed files with 9 additions and 4 deletions
|
@ -9,7 +9,7 @@ module Fog
|
|||
attribute :ami_launch_index, 'amiLaunchIndex'
|
||||
attribute :availability_zone, 'availabilityZone'
|
||||
attribute :dns_name, 'dnsName'
|
||||
attribute :group_id, 'groupId'
|
||||
attribute :groups
|
||||
attribute :image_id, 'imageId'
|
||||
attribute :state, 'instanceState'
|
||||
attribute :flavor_id, 'instanceType'
|
||||
|
@ -23,6 +23,11 @@ module Fog
|
|||
attribute :reason
|
||||
attribute :user_data
|
||||
|
||||
def initialize(attributes)
|
||||
@groups ||= []
|
||||
super
|
||||
end
|
||||
|
||||
def addresses
|
||||
requires :id
|
||||
|
||||
|
@ -99,8 +104,8 @@ module Fog
|
|||
if @availability_zone
|
||||
options['Placement.AvailabilityZone'] = @availability_zone
|
||||
end
|
||||
if @group_id
|
||||
options['SecurityGroup'] = @group_id
|
||||
unless @groups.empty?
|
||||
options['SecurityGroup'] = @groups.first
|
||||
end
|
||||
if @kernel_id
|
||||
options['KernelId'] = @kernel_id
|
||||
|
|
|
@ -26,7 +26,7 @@ module Fog
|
|||
data = connection.describe_instances(server_id).body
|
||||
data['reservationSet'].each do |reservation|
|
||||
reservation['instancesSet'].each do |instance|
|
||||
self << new(instance)
|
||||
self << new(instance.merge(:groups => reservation['groupSet']))
|
||||
end
|
||||
end
|
||||
self
|
||||
|
|
Loading…
Reference in a new issue