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

user provider with uid/gid as Integer raises warning

    XMLWordPrintable

    Details

    • Template:
      PUP Bug Template
    • Team:
      Night's Watch
    • Story Points:
      1
    • Sprint:
      NW - 2020-12-23
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Fixes warning introduced in Ruby 2.7 for checking invalid objects (such as Integer in our case) against a regular expression
    • QA Risk Assessment:
      Needs Assessment

      Description

       

       # cat foo.pp 
      user { 'user1':
        ensure             => 'present',
        gid                => 10008,
        groups             => ['bla'],
        home               => '/home/user1',
        provider           => 'useradd',
        shell              => '/bin/bash',
        uid                => '10008',
      }
       
      # puppet apply --noop foo.pp
      Notice: Compiled catalog for foo in environment production in 0.02 seconds
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/user.rb:468: warning: deprecated Object#=~ is called on Integer; it always returns nil
      Notice: /Stage[main]/Main/User[user1]/ensure: current_value 'absent', should be 'present' (noop)
      Notice: Class[Main]: Would have triggered 'refresh' from 1 event Notice: Stage[main]: Would have triggered 'refresh' from 1 event Notice: Applied catalog in 0.41 seconds
      

      vs.

       # cat foo.pp 
      user { 'user1':
        ensure             => 'present',
        gid                => '10008',
        groups             => ['bla'],
        home               => '/home/user1',
        provider           => 'useradd',
        shell              => '/bin/bash',
        uid                => '10008',
      }
       
       
       # puppet apply --noop foo.pp 
      Notice: Compiled catalog for foo in environment production in 0.02 seconds
      Notice: /Stage[main]/Main/User[user1]/ensure: current_value 'absent', should be 'present' (noop)
      Notice: Class[Main]: Would have triggered 'refresh' from 1 event
      Notice: Stage[main]: Would have triggered 'refresh' from 1 event
      Notice: Applied catalog in 0.42 seconds
      

        Attachments

          Activity

            People

            Assignee:
            luchian.nemes Luchian Nemes
            Reporter:
            duritong Peter Meier
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support