Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Normal
-
Resolution: Fixed
-
Affects Version/s: PUP 4.10.4, PUP 5.0.0
-
Fix Version/s: PUP 5.1.0
-
Component/s: None
-
Labels:None
-
Template:customfield_10700 199136
-
Sub-team:
-
Team:Agent
-
Story Points:1
-
Sprint:Agent 2017-07-12
-
Release Notes:Bug Fix
-
Release Notes Summary:If a {{Timestamp}} was created from a string with trailing unrecognized characters there would be no error and the produced {{Timestamp}} would be based on only the recognized part. This will now instead raise an error.
-
QA Risk Assessment:No Action
-
QA Risk Assessment Reason:Covered by spec tests
Description
The following puppet expression is valid:
notice(Timestamp('1969-08-20T20:18:00 UTC, one giant leap for mankind')) |
will run without errors and notice:
1969-08-20T20:18:00.000000000 UTC
|
This is because one of the default formats successfully parsed the string and managed to satisfy all of its format specifiers.
It would be desirable if Puppet could detect that the string contains trailing garbage and raise an error. Doing so is not trivial however. The Timestamp class currently relies on the DateTime#strptime function which provides no means to detect the garbage so solving this means writing a new parser.
Attachments
Issue Links
- relates to
-
PUP-7753 Timestamp doesn't provide a default format for date and time separated by space
-
- Closed
-