Issue #17457 has been updated by Jeff McCune.

Category set to zaml
Target version set to 2.7.x


----------------------------------------
Bug #17457: Date-like strings are munged during serialization, breaking puppet 
inspect runs
https://projects.puppetlabs.com/issues/17457#change-76941

Author: Ken Johnson
Status: Tests Insufficient
Priority: Normal
Assignee: David Gwilliam
Category: zaml
Target version: 2.7.x
Affected Puppet version: 
Keywords: 
Branch: https://github.com/puppetlabs/puppet/pull/1281


So, we had a customer hit an issue with the way Puppet audit changes the date 
in catalogs. This seems to pop up specifically with user resources present 
which have the expiry parameter specified. When a node is affected Puppet 
inspect runs throw an error that looks like this:

Error message from cron:
Could not run: Parameter expiry failed: Expiry dates must be YYYY-MM-DD at 
/etc/puppetlabs/puppet/modules/env/manifests/somemanifest.pp:51

Lindsey was able to replicate this by following these steps:
<pre>
To reproduce, in a PE 2.6 environment:
1) Add the following resource to site.pp:
user {'expirer': 
expiry => '2020-05-01', 
}
2) Run puppet apply -t
3) Run puppet inspect
It looks like the expiry field is getting serialized in the cached catalog in a 
way that makes it unserialize back in to Ruby as not-a-string. This causes 
inspect, which uses the cached catalog, to trip up when validating the expiry:
[3] pry(main)> '2020-05-10' !~ /^\d{4}-\d{2}-\d{2}$/
=> false
[4] pry(main)> 2020-05-10 !~ /^\d{4}-\d{2}-\d{2}$/
=> true
You can verify this is the case by editing the cached catalog and quoting the 
'expiry' value (e.g. from `!ruby/sym expiry: 2020-05-01` to `!ruby/sym expiry: 
"2020-05-01"`.
</pre>


-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to