Skip to content

Commit fbbfdd2

Browse files
committed
Convert per_page in foreman::foreman to string
CGI.escape can only deal with strings and the function accepts per_page as an integer.
1 parent e75710c commit fbbfdd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppet/functions/foreman/foreman.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def foreman(item, search, per_page = "20", foreman_url = "https://localhost", fo
6262
raise Puppet::ParseError, "Foreman: Invalid filter_result: #{filter_result}, must not be boolean true" if filter_result == true
6363

6464
begin
65-
path = "/api/#{CGI.escape(item)}?search=#{CGI.escape(search)}&per_page=#{CGI.escape(per_page)}"
65+
path = "/api/#{CGI.escape(item)}?search=#{CGI.escape(search)}&per_page=#{CGI.escape(per_page.to_s)}"
6666

6767
req = Net::HTTP::Get.new(path)
6868
req['Content-Type'] = 'application/json'

0 commit comments

Comments
 (0)