Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-10395

Gem provider reports changes when using composed requirements

    XMLWordPrintable

Details

    • Hide

      I can use composed requirements(>x, <y) with the gem provider as the gem command provides this functionality

      Show
      I can use composed requirements(>x, <y) with the gem provider as the gem command provides this functionality
    • Night's Watch
    • 2
    • NW - 2020-04-15
    • Bug Fix
    • Fix idempotency of `gem` resources with composite requirements (i.e. range intersections: `>=1.3, <2.2`)
    • Needs Assessment

    Description

      Puppet Version: 5.5.x, master

       

      When installing packages and using the gem provider, if you pass in the ensure a composed requirement('>x, <y') puppet will always report changes:

      box# cat a.pp 
      package { 'color': 
        ensure => ">1, <2", 
        provider => "gem" 
      }
      box# puppet apply a.pp --detailed-exitcodes 
      Notice: Compiled catalog for worse-swoop.delivery.puppetlabs.net in environment production in 0.41 seconds 
      Notice: /Stage[main]/Main/Package[color]/ensure: ensure changed ['1.8', '0.1.0'] to '>1, <2' 
      Notice: Applied catalog in 0.66 seconds 
      box# echo $? 2 
       
      box# puppet apply a.pp --detailed-exitcodes 
      Notice: Compiled catalog for worse-swoop.delivery.puppetlabs.net in environment production in 0.41 seconds
      Notice: /Stage[main]/Main/Package[color]/ensure: ensure changed ['1.8', '0.1.0'] to '>1, <2' 
      Notice: Applied catalog in 0.68 seconds 
      box# echo $? 2
      

      Seems like the Gem::Dependecy.new(https://github.com/ruby/ruby/blob/master/lib/rubygems/dependency.rb#L39) accepts a sparse argument and it can be used with an array but we are sending a string (https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/gem.rb#L130)

      Attachments

        Activity

          People

            gabriel.nagy Gabriel Nagy
            gheorghe.popescu Gheorghe Popescu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support