Bug #9361
puppet file resource could not contain square brackets
| Status: | Accepted | Start date: | 09/07/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | 2.7.x | |||
| Affected Puppet version: | Branch: | |||
| Keywords: | ||||
| Votes: | 2 |
Description
It seems this issue has been there quite long, someone already mentioned this here at: http://pelin.lovedthanlost.net/puppet/%23puppet-2010-09-14.log.html.
If there is any square bracket character (left or right), it would fail with message:
err: Failed to apply catalog: Prameter source failed: Could not understand source puppet:/// ....: bad URI(is not URI?) ..
if using file resource like so:
file { '/tmp/test':
source => "puppet:///modules/test/test-[test]",
...
}
Related issues
History
Updated by Egon Kastelijn 7 months ago
This problem also occurs when you create a File resource, and use “recurse => true” on a directory that contains files with brackets in the filename.
It looks a lot like this older (closed) bug: http://projects.puppetlabs.com/issues/974
Updated by Jacob Helwig 7 months ago
- Description updated (diff)
Updated by Jacob Helwig 7 months ago
- Status changed from Unreviewed to Accepted
- Target version set to 2.7.x
So, this comes from using URI.parse to handle most of the parsing of the source parameter for us. We may be able to do away with the usage of URI in the source parameter, but I haven’t checked to see if that will actually get us any further (though I suspect that it will be fine). I did check to see if percent encoding would work, and it does get past the URI parsing, but fails to find the file in the fileserver (which is why I suspect that things will be fine once the parsing is sorted in the validation stage).
Updated by Jason Barnett about 1 month ago
This becomes particularly troublesome when using puppet to distribute gnu coreutils which uses “[”, a much needed binary in day to day *nix operations.
Updated by Jason Barnett about 1 month ago
I found a work around for my problem. I simply renamed ‘[’ to ‘%5b’ (renamed the file to its percent encoding). The end result is two files, but at least I can push ‘[’ to all of my servers.
See workaround here: https://gist.github.com/2432058