Issue #20607 has been updated by Charlie Sharpsteen.

Keywords set to simplefix

----------------------------------------
Bug #20607: Fails to create lastrunfile with mode
https://projects.puppetlabs.com/issues/20607#change-93060

* Author: Dan Carley
* Status: Accepted
* Priority: Normal
* Assignee: 
* Category: settings
* Target version: 
* Affected Puppet version: 2.7.19
* Keywords: simplefix
* Branch: 
----------------------------------------
Puppet fails to create `lastrunfile` when a mode is specified and the file 
doesn't already exist:
<pre>
dcarley-mba:puppet dcarley$ cat ~/.puppet/puppet.conf
[main]
lastrunfile = $statedir/last_run_summary.yaml { mode = 644 }
dcarley-mba:puppet dcarley$ rm ~/.puppet/var/state/last_run_summary.yaml
dcarley-mba:puppet dcarley$ echo | b puppet apply --trace
Notice: Finished catalog run in 0.02 seconds
Error: Could not save last run local report: undefined method `&' for 
"644":String
/Users/dcarley/projects/ext/puppet/lib/puppet/util.rb:424:in `replace_file'
/Users/dcarley/projects/ext/puppet/lib/puppet/configurer.rb:207:in 
`save_last_run_summary'
/Users/dcarley/projects/ext/puppet/lib/puppet/configurer.rb:199:in `send_report'
/Users/dcarley/projects/ext/puppet/lib/puppet/configurer.rb:194:in `run'
/Users/dcarley/projects/ext/puppet/lib/puppet/application/apply.rb:265:in 
`apply_catalog'
/Users/dcarley/projects/ext/puppet/lib/puppet/application/apply.rb:213:in `main'
/Users/dcarley/projects/ext/puppet/lib/puppet/application/apply.rb:146:in 
`run_command'
/Users/dcarley/projects/ext/puppet/lib/puppet/application.rb:364:in `block (2 
levels) in run'
/Users/dcarley/projects/ext/puppet/lib/puppet/application.rb:456:in 
`plugin_hook'
/Users/dcarley/projects/ext/puppet/lib/puppet/application.rb:364:in `block in 
run'
/Users/dcarley/projects/ext/puppet/lib/puppet/util.rb:504:in `exit_on_fail'
/Users/dcarley/projects/ext/puppet/lib/puppet/application.rb:364:in `run'
/Users/dcarley/projects/ext/puppet/lib/puppet/util/command_line.rb:132:in `run'
/Users/dcarley/projects/ext/puppet/lib/puppet/util/command_line.rb:86:in 
`execute'
/Users/dcarley/projects/ext/puppet/bin/puppet:4:in `<top (required)>'
/Users/dcarley/projects/ext/puppet/vendor/bin/puppet:23:in `load'
/Users/dcarley/projects/ext/puppet/vendor/bin/puppet:23:in `<main>'
</pre>

It's fine when the file does exist:
<pre>
dcarley-mba:puppet dcarley$ touch ~/.puppet/var/state/last_run_summary.yaml
dcarley-mba:puppet dcarley$ echo | b puppet apply --trace
Notice: Finished catalog run in 0.02 seconds
</pre>

Observed with:

- Puppet 2.7.19 / Ruby 1.8.7
- Puppet 3.1.1 / Ruby 1.9.3

[`Puppet.settings.setting(:lastrunfile).mode`](https://github.com/puppetlabs/puppet/blob/3.1.1/lib/puppet/util.rb#L424)
 returns a string when 
[`Puppet::Util.replace_file`](https://github.com/puppetlabs/puppet/blob/3.1.1/lib/puppet/util.rb#L424)
 expects an integer. This is closely related to #15539.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to