Skip to content

Commit

Permalink
JSON.dump backup_destination instead of YAML.dump(...).sub(...)
Browse files Browse the repository at this point in the history
YAML.dump is slightly inconsistent across ruby/yaml versions so the
substitution doesn't always work. Just JSON.dump in the one place we use
it since JSON is a subset of YAML

[#96930436](https://www.pivotaltracker.com/story/show/96930436)

Signed-off-by: Colin Obyrne <cobyrne@pivotal.io>
  • Loading branch information
lwoydziak committed Jun 19, 2015
1 parent ad18d25 commit d61d310
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions release/jobs/director/templates/director.yml.erb.erb
@@ -1,10 +1,3 @@
<%
require "yaml"

def dump_yaml(name, options)
YAML.dump(name => options).sub(/\A---\n/, '')
end
%>
---
name: <%= p('director.name') %>
port: <%= p('director.backend_port') %>
Expand Down Expand Up @@ -219,7 +212,7 @@ compiled_package_cache:
<% end %>
<% if_p('director.backup_destination') do |backup_destination| %>
<%= dump_yaml('backup_destination', backup_destination) %>
backup_destination: <%= JSON.dump(backup_destination) %>
<% end %>

cloud:
Expand Down

0 comments on commit d61d310

Please sign in to comment.