Skip to content

Commit

Permalink
Use JSON pretty_generate
Browse files Browse the repository at this point in the history
  • Loading branch information
n0ts committed Feb 10, 2017
1 parent abd3dd8 commit 5bba32b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/kumogata/client.rb
Expand Up @@ -340,7 +340,9 @@ def create_stack(template, stack_name)
end

Kumogata.logger.info("Creating stack: #{stack_name}".cyan)
stack = @cloud_formation.stacks.create(stack_name, template.to_json, build_create_options)
stack = @cloud_formation.stacks.create(stack_name,
JSON.pretty_generate(template),
build_create_options)

return if @options.detach?

Expand Down Expand Up @@ -371,7 +373,7 @@ def update_stack(template, stack_name)

Kumogata.logger.info("Updating stack: #{stack_name}".green)
event_log = create_event_log(stack)
stack.update(build_update_options(template.to_json))
stack.update(build_update_options(JSON.pretty_generate(template)))

return if @options.detach?

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -28,7 +28,7 @@ def tempfile(content, template_ext = nil)
basename = [basename, template_ext] if template_ext

Tempfile.open(basename) do |f|
f << content
f << content.chomp
f.flush
f.rewind
yield(f)
Expand Down

0 comments on commit 5bba32b

Please sign in to comment.