Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix automatic coercion warning #743

Merged
merged 2 commits into from
Feb 16, 2018

Conversation

smortex
Copy link
Collaborator

@smortex smortex commented Jan 26, 2018

Explicitly cast the return value of strftime() to an Integer to avoid spamming the puppet server log file with warning messages:

Jan 26 14:19:13 <daemon.warn> marvin puppet-master[27147]: The string '1516972753' was automatically coerced to the numerical value 1516972753 at /usr/local/etc/puppet/environments/production/modules/apt/manifests/update.pp:17:27
Jan 26 14:19:25 <daemon.warn> marvin puppet-master[27147]: The string '1516972765' was automatically coerced to the numerical value 1516972765 at /usr/local/etc/puppet/environments/production/modules/apt/manifests/update.pp:17:27
Jan 26 14:19:55 <daemon.warn> marvin puppet-master[27147]: The string '1516972795' was automatically coerced to the numerical value 1516972795 at /usr/local/etc/puppet/environments/production/modules/apt/manifests/update.pp:17:27
Jan 26 14:20:15 <daemon.warn> marvin puppet-master[27147]: The string '1516972815' was automatically coerced to the numerical value 1516972815 at /usr/local/etc/puppet/environments/production/modules/apt/manifests/update.pp:17:27

Explicitly cast the return value of strftime() to an Integer to avoid
spamming the puppet server log file with warning messages:

Jan 26 14:19:13 <daemon.warn> marvin puppet-master[27147]: The string '1516972753' was automatically coerced to the numerical value 1516972753 at /usr/local/etc/puppet/environments/production/modules/apt/manifests/update.pp:17:27
Jan 26 14:19:25 <daemon.warn> marvin puppet-master[27147]: The string '1516972765' was automatically coerced to the numerical value 1516972765 at /usr/local/etc/puppet/environments/production/modules/apt/manifests/update.pp:17:27
Jan 26 14:19:55 <daemon.warn> marvin puppet-master[27147]: The string '1516972795' was automatically coerced to the numerical value 1516972795 at /usr/local/etc/puppet/environments/production/modules/apt/manifests/update.pp:17:27
Jan 26 14:20:15 <daemon.warn> marvin puppet-master[27147]: The string '1516972815' was automatically coerced to the numerical value 1516972815 at /usr/local/etc/puppet/environments/production/modules/apt/manifests/update.pp:17:27
@smortex smortex force-pushed the fix-automatic-coercion-warning branch from c910804 to 60923a2 Compare January 26, 2018 16:06
This commit fixes the following warning in the puppet master's logs:

Jan 26 16:09:26 <daemon.warn> marvin puppet-master[68168]: The argument signature (String format, [String timezone]) is deprecated for #strfime. See #strftime documentation and Timespan type for more info
Jan 26 16:09:26 <daemon.warn> marvin puppet-master[68168]:    (at /usr/local/etc/puppet/environments/production/modules/apt/manifests/update.pp:17)
@smortex smortex force-pushed the fix-automatic-coercion-warning branch from c910804 to 4f11ef2 Compare January 26, 2018 16:07
@smortex
Copy link
Collaborator Author

smortex commented Jan 26, 2018

BTW, the typo visible in 4f11ef2 is being addressed in puppetlabs/puppet#6579

@david22swan david22swan merged commit cef5627 into puppetlabs:master Feb 16, 2018
@smortex smortex deleted the fix-automatic-coercion-warning branch February 16, 2018 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants