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:
commit
f3a1920a2e
1 changed files with 8 additions and 2 deletions
|
@ -13,12 +13,18 @@ module Fog
|
||||||
}
|
}
|
||||||
|
|
||||||
vanilla_options = ['metadata', 'accessIPv4', 'accessIPv6',
|
vanilla_options = ['metadata', 'accessIPv4', 'accessIPv6',
|
||||||
'availability_zone', 'user_data', 'key_name',
|
'availability_zone', 'user_data', 'key_name', 'adminPass']
|
||||||
'security_groups', 'adminPass']
|
|
||||||
vanilla_options.select{|o| options[o]}.each do |key|
|
vanilla_options.select{|o| options[o]}.each do |key|
|
||||||
data['server'][key] = options[key]
|
data['server'][key] = options[key]
|
||||||
end
|
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']
|
if options['personality']
|
||||||
data['server']['personality'] = []
|
data['server']['personality'] = []
|
||||||
for file in options['personality']
|
for file in options['personality']
|
||||||
|
|
Loading…
Reference in a new issue