Open aptituz opened 4 years ago
I wonder if this explains the EL7 acceptance test failure in docker. Could you come up with a patch?
I opened https://github.com/voxpupuli/puppet-jenkins/pull/996 with your suggestion to see if it fixes the EL7 Docker install test.
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
The problem is triggered when installing plugins, for which the manifest contains UTF-8 sequences. This is the case, for example, when jenkins::plugins_hash contains the ws-cleanup plugin in version 0.38.
The problem can then be reproduced in two ways:
When invoking facter directly, the problem seems to be independent from the locale, so just running
should be enough to reproduce it.
What are you seeing
When running puppet it will try to install some plugins again and again. In the facter output the plugins will be missing.
What behaviour did you expect instead
I would expect the plugin to install modules only once and the jenkins_plugins fact to return all facts.
Any additional information you'd like to impart
We are running puppet as part of bootstrapping machines via cloud-init. In this constellation puppet runs with a very minimal environment and in this case this means that no LANG variable is set.
The problem can be traced down to the code that reads the manifest file (https://github.com/voxpupuli/puppet-jenkins/blob/master/lib/puppet/jenkins/plugins.rb#L57). In files that contain UTF-8 sequences this would trigger an exception which leads to the plugin being excluded from the output.
A possible fix is to to change the File.read invocation like this: