1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #1145 from ohadlevy/openstack-fixes

[Openstack|Compute] Security Groups are not assigned correctly to servers
This commit is contained in:
Wesley Beary 2012-09-13 08:19:42 -07:00
commit f3a1920a2e

View file

@ -13,12 +13,18 @@ module Fog
}
vanilla_options = ['metadata', 'accessIPv4', 'accessIPv6',
'availability_zone', 'user_data', 'key_name',
'security_groups', 'adminPass']
'availability_zone', 'user_data', 'key_name', 'adminPass']
vanilla_options.select{|o| options[o]}.each do |key|
data['server'][key] = options[key]
end
if options['security_groups']
# security names requires a hash with a name prefix
data['server']['security_groups'] = [options['security_groups']].flatten.map do |sg|
{ :name => sg.is_a?(Fog::Compute::OpenStack::SecurityGroup) ? sg.name : sg }
end
end
if options['personality']
data['server']['personality'] = []
for file in options['personality']