This message was deleted.
# voxpupuli
s
This message was deleted.
k
ah I figured it out, needs parentheses
(also, better tests to catch things like this)
s
Oh! You mean
! (expression)
?
!
has a higher precedance than
in
?
That's a bug, and yes, parenthesis will help
k
How does my new PR title look?
s
Better 🙂 I am not a user of the module, so it does not "speak" to me, but as an end-user I think it makes sense.
👍 1
@kenyon++
d
kenyon is on the rise! (Karma: 3)
k
I’ll merge this, maybe someone wants to do a bugfix release, I need to get to sleep, otherwise I can later
s
I think a quick fix make sense. I'll prepare this but may not be able to follow up because of EVACATIONS and I will be AFK for one week starting tomorrow.
👍 1
v
@smortex, what is the replacement for the removed function?
For now I have replaced it with a function , since some of forge modules still use it
Copy code
Puppet::Functions.create_function(:is_function_available) do
  dispatch :is_function_available do
    param 'String', :str
  end

  def is_function_available(str)
    function = Puppet::Parser::Functions.function(str)
    function.is_a?(String) && !function.empty?
  end
end
s
Hum, you mean this deprecated function was in fact not deprecated. Never used it and saw 0 usage of it at voxpupuli, so removing a function which is marked deprecated and tells it would be removed in the future before a new major release made sense to me … thinking
It looks like puppetlabs module use it to detect if running PE or not, so deprecating it in https://github.com/puppetlabs/puppetlabs-stdlib/commit/48d89de56846c1df4d0c63f0f2274fbe4023ce41#diff-5a4a16ceb481ca5ac1451f288a6db046d8c363d4ffe5749aec0cdca1fc85c511 was maybe a mistake?
v
yep, it was removed from r10k recently, but it is still in puppetlabs/puppet_agent, for example
s
I could not find some kind of 'function_name =~ Callable[...] ' that does the same, did you find one?
v
nope, that's why I asked, I ended up dropping replacement into my local module
s
Okay. Reverting the function, removing the deprecation, and releasing a patch release of stdlib makes sense then.
I will not be able to handle this because I am about to go for a week on vacations. Do you want to start this?
v
I did a search in github, it is not used in many places. puppet_metrics_dashboard (seems deprecated) , icingaweb, puppet_agent and previous version of r10k
so maybe fixing puppet_agent is better then resurrect it?
s
Yeah, checking for a function existence is kind of a smell for me.
for backwards compatibility, most likely
s
Checking for the variable looks better but might not be reliable enough? In this case a is_pe() core function in puppet core would be best solution I think.
Hum, this discussion is unrelated to the initial thread. Maybe we should open a new one and Cc some Puppet folks to help with this issue and stop notifying kenyon (sorry!)
oops 1
👍 1