Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
PUP 3.7.4
-
Coremunity
-
Platform Core KANBAN
-
Enhancement
-
Improve the error message that occurs when trying to manage a file resource whose parent directory doesn't exist.
Description
When managing a file, if you specify a location that requires an intermediate directory that is missing, and not managed by puppet, the error message is misleading. It implies that the issue is with the temp file created, rather than the missing directory itself. For example, when managing /etc/eyaml/config.yaml, /etc/eyaml does not exist:
Catalog:
file {'/etc/eyaml/config.yaml':
|
ensure => file,
|
content => template('eyaml/config.yaml.erb'),
|
}
|
Error:
|
Error: Could not set 'file' on ensure: No such file or directory - /etc/eyaml/config.yaml20150420-14321-me6waj.lock at 66:/etc/puppetlabs/puppet/environments/eyaml/dist/eyaml/manifests/init.pp
|
Error: Could not set 'file' on ensure: No such file or directory - /etc/eyaml/config.yaml20150420-14321-me6waj.lock at 66:/etc/puppetlabs/puppet/environments/eyaml/dist/eyaml/manifests/init.pp
|
Wrapped exception:
|
No such file or directory - /etc/eyaml/config.yaml20150420-14321-me6waj.lock
|
Error: /Stage[main]/Eyaml/File[/etc/eyaml/config.yaml]/ensure: change from absent to file failed: Could not set 'file' on ensure: No such file or directory - /etc/eyaml/config.yaml20150420-14321-me6waj.lock at 66:/etc/puppetlabs/puppet/environments/eyaml/dist/eyaml/manifests/init.pp
|
The preference would be to generate an error that indicates that /etc/eyaml does not exist, or even a generic "Parent directories for $file do not exist"