Skip to content

Commit 9888936

Browse files
author
Kevin Paulisse
committed
Extra escape of the facts is expected by Puppet
1 parent e3122df commit 9888936

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/octocatalog-diff/catalog/puppetmaster.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,17 @@ def build(logger = Logger.new(StringIO.new))
6868

6969
# Returns a hash of parameters for each supported version of the Puppet Server Catalog API.
7070
# @return [Hash] Hash of parameters
71+
#
72+
# Note: The double escaping of the facts here is implemented to correspond to a long standing
73+
# bug in the Puppet code. See https://github.com/puppetlabs/puppet/pull/1818 and
74+
# https://docs.puppet.com/puppet/latest/http_api/http_catalog.html#parameters for explanation.
7175
def puppet_catalog_api
7276
{
7377
2 => {
7478
url: "https://#{@options[:puppet_master]}/#{@options[:branch]}/catalog/#{@node}",
7579
parameters: {
7680
'facts_format' => 'pson',
77-
'facts' => @facts.fudge_timestamp.without('trusted').to_pson,
81+
'facts' => CGI.escape(@facts.fudge_timestamp.without('trusted').to_pson),
7882
'transaction_uuid' => SecureRandom.uuid
7983
}
8084
},
@@ -83,7 +87,7 @@ def puppet_catalog_api
8387
parameters: {
8488
'environment' => @options[:branch],
8589
'facts_format' => 'pson',
86-
'facts' => @facts.fudge_timestamp.without('trusted').to_pson,
90+
'facts' => CGI.escape(@facts.fudge_timestamp.without('trusted').to_pson),
8791
'transaction_uuid' => SecureRandom.uuid
8892
}
8993
}

0 commit comments

Comments
 (0)