FAQ
Hi,

I'm currently in the process of writing my first puppet script and I've hit
a a problem with the pip package provider. It seems like the puppet pip
provider is looking for executable by the name of 'pip' but under Centos 6,
the executable goes by the name 'pip-python'. While I can probably hack a
workaround in, I'm curious if there is a preferred method of doing this?
Should I try and extend the pip provider, create something akin to an alias
or do something else entirely?

I'm using the Puppet 3.0.1 release and Centos 6.3 for what it's worth.

Thanks for any advice

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/UejD6w2u02MJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Joshua Vote at Dec 17, 2012 at 2:20 am
    I alluded to hacky workarounds in the OP - the below is what I'm currently
    using. It seems to work OK in a very non portable manner

    file { '/usr/bin/pip':
    ensure => 'link',
    target => '/usr/bin/pip-python',
    }

    It would be great to hear if anyone knows of a preferred way to go about
    this. I'm very new to puppet but not afraid to get my hands dirty,
    On Friday, December 14, 2012 4:12:02 PM UTC+8, Joshua Vote wrote:

    Hi,

    I'm currently in the process of writing my first puppet script and I've
    hit a a problem with the pip package provider. It seems like the puppet pip
    provider is looking for executable by the name of 'pip' but under Centos 6,
    the executable goes by the name 'pip-python'. While I can probably hack a
    workaround in, I'm curious if there is a preferred method of doing this?
    Should I try and extend the pip provider, create something akin to an alias
    or do something else entirely?

    I'm using the Puppet 3.0.1 release and Centos 6.3 for what it's worth.

    Thanks for any advice
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/JsoNSCaJ_F0J.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • 刘长元 at Dec 18, 2012 at 1:04 am
    https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/pip.rb

    this is pip's source file.
    in the end, you can see this

    private
    def lazy_pip(*args)
    pip *args
    rescue NoMethodError => e
    if pathname = which('pip')
    self.class.commands :pip => pathname
    pip *args
    else
    raise e, 'Could not locate the pip command.'
    end
    end

    other functions call lazy_pip to install or uninstall packages.
    and lazy_pip use which to find where is the 'pip' command.


    在 2012年12月14日星期五UTC+8下午4时12分02秒,Joshua Vote写道:
    Hi,

    I'm currently in the process of writing my first puppet script and I've
    hit a a problem with the pip package provider. It seems like the puppet pip
    provider is looking for executable by the name of 'pip' but under Centos 6,
    the executable goes by the name 'pip-python'. While I can probably hack a
    workaround in, I'm curious if there is a preferred method of doing this?
    Should I try and extend the pip provider, create something akin to an alias
    or do something else entirely?

    I'm using the Puppet 3.0.1 release and Centos 6.3 for what it's worth.

    Thanks for any advice
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/V-cXSWl2QiYJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Joshua Vote at Dec 18, 2012 at 8:39 am
    Yeah, I saw that function. Is there a way I can extend the class and
    override that method for my own use? Or will I need to make the fix myself
    and submit a pull request?
    On Tuesday, December 18, 2012 9:01:35 AM UTC+8, 刘长元 wrote:


    https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/pip.rb

    this is pip's source file.
    in the end, you can see this

    private
    def lazy_pip(*args)
    pip *args
    rescue NoMethodError => e
    if pathname = which('pip')
    self.class.commands :pip => pathname
    pip *args
    else
    raise e, 'Could not locate the pip command.'
    end
    end

    other functions call lazy_pip to install or uninstall packages.
    and lazy_pip use which to find where is the 'pip' command.


    在 2012年12月14日星期五UTC+8下午4时12分02秒,Joshua Vote写道:
    Hi,

    I'm currently in the process of writing my first puppet script and I've
    hit a a problem with the pip package provider. It seems like the puppet pip
    provider is looking for executable by the name of 'pip' but under Centos 6,
    the executable goes by the name 'pip-python'. While I can probably hack a
    workaround in, I'm curious if there is a preferred method of doing this?
    Should I try and extend the pip provider, create something akin to an alias
    or do something else entirely?

    I'm using the Puppet 3.0.1 release and Centos 6.3 for what it's worth.

    Thanks for any advice
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/WHjAJ0hZkb8J.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Jakov Sosic at Dec 19, 2012 at 1:58 am

    On 12/18/2012 09:39 AM, Joshua Vote wrote:
    Yeah, I saw that function. Is there a way I can extend the class and
    override that method for my own use? Or will I need to make the fix
    myself and submit a pull request?
    Pull request would be far better off because everyone would benefit from it.


    --
    Jakov Sosic
    www.srce.unizg.hr

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Joshua Vote at Dec 20, 2012 at 6:41 am
    If anyone else is watching this issue: the pull request has been made and
    attached to issue - http://projects.puppetlabs.com/issues/18236
    On Wednesday, December 19, 2012 9:58:06 AM UTC+8, Jakov Sosic wrote:
    On 12/18/2012 09:39 AM, Joshua Vote wrote:
    Yeah, I saw that function. Is there a way I can extend the class and
    override that method for my own use? Or will I need to make the fix
    myself and submit a pull request?
    Pull request would be far better off because everyone would benefit from
    it.


    --
    Jakov Sosic
    www.srce.unizg.hr
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/zDlezGGPS-wJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Jared Curtis at Dec 21, 2012 at 7:48 am
    I've created another pull request that's a little more flexible than your
    version. If some other OS uses a different name for pip then it can easily
    be added to the case statement.

    https://github.com/puppetlabs/puppet/pull/1346
    On Wednesday, December 19, 2012 10:41:16 PM UTC-8, Joshua Vote wrote:

    If anyone else is watching this issue: the pull request has been made and
    attached to issue - http://projects.puppetlabs.com/issues/18236
    On Wednesday, December 19, 2012 9:58:06 AM UTC+8, Jakov Sosic wrote:
    On 12/18/2012 09:39 AM, Joshua Vote wrote:
    Yeah, I saw that function. Is there a way I can extend the class and
    override that method for my own use? Or will I need to make the fix
    myself and submit a pull request?
    Pull request would be far better off because everyone would benefit from
    it.


    --
    Jakov Sosic
    www.srce.unizg.hr
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/zXYpUb7h1q4J.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedDec 14, '12 at 11:46a
activeDec 21, '12 at 7:48a
posts7
users4
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase