Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/153970

Change subject: ordered_yaml(): omit document header
......................................................................

ordered_yaml(): omit document header

According to the YAML spec, 'If no explicit header line is specified at the
start of the stream, the processor should behave as if a header line containing
an unadorned “---” was specified.' (<http://yaml.org/spec/1.0/>). Since some
applications barf on the document header, omit it.

Change-Id: Id8163d372669b8d7fcae30e7cd40bbbbf419c7a7
---
M modules/wmflib/lib/puppet/parser/functions/ordered_json.rb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/70/153970/1

diff --git a/modules/wmflib/lib/puppet/parser/functions/ordered_json.rb 
b/modules/wmflib/lib/puppet/parser/functions/ordered_json.rb
index 7cefe32..2881495 100644
--- a/modules/wmflib/lib/puppet/parser/functions/ordered_json.rb
+++ b/modules/wmflib/lib/puppet/parser/functions/ordered_json.rb
@@ -27,7 +27,7 @@
 module Puppet::Parser::Functions
     {:ordered_json => :to_json, :ordered_yaml => :to_yaml}.each do |func, 
method|
         newfunction(func, :type => :rvalue, :arity => 1) do |args|
-            sort_keys_recursive(args.first).send(method)
+            sort_keys_recursive(args.first).send(method).gsub(/^---\s*/, '') 
<< "\n"
         end
     end
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/153970
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8163d372669b8d7fcae30e7cd40bbbbf419c7a7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to