From 60923a2e88b2df33fd0e80442fd3725ef83a023b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Romain=20Tarti=C3=A8re?= Date: Fri, 26 Jan 2018 14:32:30 +0100 Subject: [PATCH] Fix automatic coercion warning 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 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 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 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 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 --- manifests/update.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/update.pp b/manifests/update.pp index 00e0600..f3871c0 100644 --- a/manifests/update.pp +++ b/manifests/update.pp @@ -14,7 +14,7 @@ class apt::update { 'daily': { #compare current date with the apt_update_last_success fact to determine #if we should kick apt_update. - $daily_threshold = (strftime('%s') - 86400) + $daily_threshold = (Integer(strftime('%s')) - 86400) if $::apt_update_last_success { if $::apt_update_last_success + 0 < $daily_threshold { $_kick_apt = true @@ -29,7 +29,7 @@ class apt::update { 'weekly':{ #compare current date with the apt_update_last_success fact to determine #if we should kick apt_update. - $weekly_threshold = (strftime('%s') - 604800) + $weekly_threshold = (Integer(strftime('%s')) - 604800) if $::apt_update_last_success { if ( $::apt_update_last_success + 0 < $weekly_threshold ) { $_kick_apt = true -- 2.45.2