| The following puppet code which used the ISO 8601 week-based year and week number parsing as indicated in the documentation fails
notice(Timestamp.new('2022011', '%G%V%w')) |
The error is the following:
Error: Evaluation Error: Error while evaluating a Method call, no implicit conversion of nil into Integer (file: /tmp/test.pp, line: 1, column: 21) on node |
Which is far from useful. This error seems to come from https://github.com/puppetlabs/puppet/blob/main/lib/puppet/pops/time/timestamp.rb#L106 where the code expect parsed datetime to have a :year entry, unfortunaly the hash doesn't have this key:
irb(main):002:0> DateTime._strptime('2022011', '%G%V%w') |
=> {:cwyear=>2022, :cweek=>1, :wday=>1} |
|