pip package provider on Redhat

31 views
Skip to first unread message

Sergei Gerasenko

unread,
Oct 17, 2018, 6:18:23 AM10/17/18
to Puppet Users
Hello,

I'm running puppet 3.5.1 and the pip package provider has this bit:

  def self.cmd
    case Facter.value(:osfamily)
      when "RedHat"
        "pip-python"
      else
        "pip"
    end
  end

As you can see, when the OS is RedHat, it wants to use the pip-python command, but it's not available for latest versions of Redhat/CentOS. Is there an easy way to override the command for that provider without altering the puppet source code?

Ben Ford

unread,
Oct 17, 2018, 6:22:05 AM10/17/18
to puppet...@googlegroups.com
Hi Sergei!

Puppet 3.x is quite old, and in fact has been end-of-lifed for 655 days as of today! (December 31, 2016). It is no longer receiving security or bug fixes. If you upgrade to a modern version, you'll see that there's are new pip and pip3 providers that use the appropriate commands. https://github.com/puppetlabs/puppet/blob/1707f2ca46867651095e01379bd01dab08076b8b/lib/puppet/provider/package/pip.rb#L55-L65


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c15b51cd-23fa-4406-ad92-ff3e2b63c839%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sergei Gerasenko

unread,
Oct 18, 2018, 2:41:16 PM10/18/18
to Puppet Users

Yeah, I know we're old. I'm asking in general though (imagining it would be happening with the current version for example?), what would be an elegant way to fix this?

David Schmitt

unread,
Oct 19, 2018, 8:00:51 AM10/19/18
to puppet...@googlegroups.com
To answer your original question: no, there is no way to override the ruby code without modifying the ruby code.


For more options, visit https://groups.google.com/d/optout.
--

jcbollinger

unread,
Oct 19, 2018, 9:29:29 AM10/19/18
to Puppet Users


On Friday, October 19, 2018 at 7:00:51 AM UTC-5, David Schmitt wrote:
To answer your original question: no, there is no way to override the ruby code without modifying the ruby code.

I guess it depends on what one means by "override".  The existing provider cannot be made to work differently without modifying its code, but one could create a new, distinct provider by either copying or extending the existing one, and make that one operate as desired.  In the "extending" alternative, it is plausible that effecting the desired behavior change would indeed take the form of "overriding", in the Ruby sense of that term.  That still requires Ruby coding, but it does not involve changing shipped with Puppet.


John

Sergei Gerasenko

unread,
Oct 22, 2018, 7:43:04 AM10/22/18
to Puppet Users
Cool, thank you for the info. I know my options a bit better now.


On Friday, October 19, 2018 at 7:00:51 AM UTC-5, David Schmitt wrote:

Sergei Gerasenko

unread,
Oct 22, 2018, 7:44:31 AM10/22/18
to Puppet Users
Thank you for your response, John. I know my options now.
Reply all
Reply to author
Forward
0 new messages