Jira (PUP-9109) File: source attribute broken for HTTP(s) URI's containing query parameters

0 views
Skip to first unread message

Matthias Baur (JIRA)

unread,
Sep 6, 2018, 7:03:03 AM9/6/18
to puppe...@googlegroups.com
Matthias Baur created an issue
 
Puppet / Bug PUP-9109
File: source attribute broken for HTTP(s) URI's containing query parameters
Issue Type: Bug Bug
Affects Versions: PUP 5.5.6, PUP 4.10.0
Assignee: Matthias Baur
Created: 2018/09/06 4:02 AM
Priority: Normal Normal
Reporter: Matthias Baur

Puppet Version: 4.4.0 - 5.5.6
Puppet Server Version: All
OS Name/Version: All

We want to use the `source` attribute of the file type to get host specific stuff from a web service. For this we're using the following code:

file { '/etc/path/to/file':
  ensure => file,
  source => 'https://fancywebservice.example.org/get_host_specific_config.py?host=foobar'
}

The important part here is the `host=foobar` parameter. If it's not added, the web service will return a 404.

Desired Behavior:
The file type should be able to retrieve a file from a http(s) URL which contains query parameters

Actual Behavior:

Error: /Stage[main]/Main/File[/etc/path/to/file]: Could not evaluate: Could not retrieve information from environment production source(s) https://fancywebservice.example.org/get_host_specific_config.py?host=foobar

This happens, because Puppet, for reason unknown to me, requests only the `path` element of the uri and skips on the query parameters:

https://github.com/puppetlabs/puppet/blob/7ec328f0832492353cad5b2b3ae6e90449fa105f/lib/puppet/util/http_proxy.rb#L184

 

I will submit a PR to fix this.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Matthias Baur (JIRA)

unread,
Sep 6, 2018, 7:39:02 AM9/6/18
to puppe...@googlegroups.com

Matthias Baur (JIRA)

unread,
Sep 6, 2018, 7:39:03 AM9/6/18
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Mar 29, 2019, 1:19:02 PM3/29/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Sep 11, 2019, 1:11:03 AM9/11/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Sep 11, 2019, 1:11:03 AM9/11/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Sep 11, 2019, 1:11:04 AM9/11/19
to puppe...@googlegroups.com

Kris Bosland (JIRA)

unread,
Sep 11, 2019, 5:09:03 PM9/11/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Sep 16, 2019, 12:35:03 PM9/16/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes Summary: Puppet now preserves query parameters when retrieving file metadata and content for http/https file resources.
Release Notes: Bug Fix

Mihai Buzgau (JIRA)

unread,
Sep 26, 2019, 6:09:03 AM9/26/19
to puppe...@googlegroups.com

Jean Bond (JIRA)

unread,
Sep 30, 2019, 1:04:03 PM9/30/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages