You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`time` was both an old API ruby function, and not needed since Puppet 4.
In this commit, the `parser` function is removed and replaced by a
non-namespaced APIv4 function. This is done to preserve compatibility
before the function is removed completely in a later release.
The ruby function calls a Puppet language function which implements the
existing behaviour using core Puppet functionality.
The original function did something weird with an optional `timezone`
parameter. Nobody really remembers why. It appears that very early
versions of Ruby may have been buggy and needed this as a workaround.
To be clear, seconds since the epoch are the same _everywhere_. Timezone
is not relevant.
# @summary This function is deprecated. It implements the functionality of the original non-namespaced stdlib `time` function.
2
+
#
3
+
# It is provided for compatability, but users should use the native time related functions directly.
4
+
#
5
+
# @param _timezone
6
+
# This parameter doesn't do anything, but exists for compatability reasons
7
+
function stdlib::time(Optional[String] $_timezone = undef) >> Integer {
8
+
# Note the `timezone` parameter doesn't do anything and didn't in the ruby implementation for _years_ (pre 1.8.7 perhaps ???)
9
+
deprecation('time', 'The stdlib `time` function is deprecated. Please direcly use native Puppet functionality instead. eg. `Integer(Timestamp().strftime(\'%s\'))`', false)
0 commit comments