Jira (PUP-7785) certname containing only numbers throws error message

1 view
Skip to first unread message

Josh Cooper (JIRA)

unread,
Jul 18, 2017, 4:36:03 PM7/18/17
to puppe...@googlegroups.com
Josh Cooper moved an issue
 
Puppet / Bug PUP-7785
certname containing only numbers throws error message
Change By: Josh Cooper
Key: PA PUP - 1316 7785
Project: Puppet  Agent
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Josh Cooper (JIRA)

unread,
Jul 18, 2017, 4:41:02 PM7/18/17
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-7785
 
Re: certname containing only numbers throws error message

Puppet's settings have always (at least since 3.x) assumed that if a setting value is entirely digits, then we must be able to parse it as an Integer: https://github.com/puppetlabs/puppet/blob/4.0.0/lib/puppet/settings/value_translator.rb#L8. In this case, puppet thinks the certname value is an integer and will fail to parse it:

Error: Could not parse /etc/puppetlabs/puppet/puppet.conf: invalid value for Integer(): "000000000180"
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/value_translator.rb:8:in `Integer'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/value_translator.rb:8:in `[]'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/config_file.rb:100:in `parse_setting'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/config_file.rb:36:in `block (2 levels) in parse_file'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/config_file.rb:34:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/config_file.rb:34:in `block in parse_file'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/config_file.rb:30:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings/config_file.rb:30:in `parse_file'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:527:in `parse_config'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:599:in `parse_config_files'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:266:in `initialize_global_settings'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:199:in `do_initialize_settings_for_run_mode'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:193:in `initialize_settings'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:67:in `block in execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:666:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:66:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

It seems like we should be taking the setting type into account, so that we don't blindly try to coerce Strings that happen to look like Numerics.

Josh Cooper (JIRA)

unread,
Jul 18, 2017, 4:41:03 PM7/18/17
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 11, 2021, 7:54:02 PM6/11/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-7785
 
Re: certname containing only numbers throws error message

PUP-8289 is the same issue but for environment names. From my comment there:

We just need to pass the setting object instead of the value, as for example the BooleanSetting already knows how to munge strings case-insensitively.

 

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages