From 0c284b91a46ccbfc8ea569d7040c09bea1826183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 11 Apr 2024 14:43:45 -1000 Subject: [PATCH] Fix strftime() deprecation warning When running on Puppet 8, a warning is produced: ``` The argument signature (String format, [String timezone]) is deprecated for #strftime. See #strftime documentation and Timespan type for more info ``` Pass a timestamp as the first parameter to use a non-deprecated signature of the function `(Timespan $time_object, String $format)`. --- manifests/install/windows.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/install/windows.pp b/manifests/install/windows.pp index 5da7328e..f3e5b24c 100644 --- a/manifests/install/windows.pp +++ b/manifests/install/windows.pp @@ -57,7 +57,7 @@ $_puppet_run_wait = undef } - $_timestamp = strftime('%Y_%m_%d-%H_%M') + $_timestamp = Timestamp().strftime('%Y_%m_%d-%H_%M') $_logfile = windows_native_path("${facts['env_temp_variable']}/puppet-${_timestamp}-installer.log") notice ("Puppet upgrade log file at ${_logfile}")