mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1469 from davetchen/master
Add Tags to create_stack call
This commit is contained in:
commit
d4d6c1d2bd
1 changed files with 17 additions and 0 deletions
|
@ -51,6 +51,23 @@ module Fog
|
|||
end
|
||||
end
|
||||
|
||||
num_tags = 0
|
||||
if options['Tags']
|
||||
options['Tags'].keys.each_with_index do |key, index|
|
||||
index += 1 # tags are 1-indexed
|
||||
num_tags += 1 # 10 tag max
|
||||
|
||||
params.merge!({
|
||||
"Tags.member.#{index}.Key" => key,
|
||||
"Tags.member.#{index}.Value" => options['Tags'][key]
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
if num_tags > 10
|
||||
raise ArgumentError.new("a maximum of 10 tags can be specified <#{num_tags}>")
|
||||
end
|
||||
|
||||
if options['TemplateBody']
|
||||
params['TemplateBody'] = options['TemplateBody']
|
||||
elsif options['TemplateURL']
|
||||
|
|
Loading…
Add table
Reference in a new issue