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

Puppet should allow setting null property value

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 3.6.2, PUP 3.7.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Solaris 11.2+

      Description

      On evsadm (and many other commands), it takes null value to reset a specific parameter.
      i.e.)

      # evsadm set-evsprop -p maxbw= HR
      

      This command will reset the value of maxbw of the evs instance, HR.
      (Please note that maxbw is blank, not HR. HR is the evs name )

      This makes total sense since there is no default value for maxbw and null(blank) means that a user wants to reset it to none.

      This method works fine with Puppet when you do 'apply'.

      # puppet apply -e "evs{'sys-global/HR': maxbw=>''}"
      Notice: Compiled catalog for bamd-sfb-01.us.oracle.com in environment production in 0.07 seconds
      Notice: /Stage[main]/Main/Evs[sys-global/HR]/maxbw: maxbw changed '1G' to ''
      Notice: Finished catalog run in 6.28 seconds
      

      However Puppet resource doesn't seem happy with null value for a parameter.

      # puppet resource evs sys-global/HR maxbw='' --debug
      Error: Could not run: Invalid parameter setting maxbw=
      

      Puppet should allow setting an empty parameter by the puppet command.

      The values:

         maxbw=
         maxbw=''
      

      From the puppet command's perspective, are exactly the same thing, and should really be valid.

      Taking a look at the code, it would seem to be that...

      In the file:

         /usr/ruby/1.9/lib/amd64/ruby/vendor_ruby/1.9.1/puppet/application/resource.rb
      

      The first problem that I see in the code is:

          args.each do |setting|
            if setting =~ /^(\w+)=(.+)$/
              params[$1] = $2
            else
              raise "Invalid parameter setting #{setting}"
            end
          end
      

      What I get from reading this is that the value after the '=' must contain at least one character, which of course something like 'maxbw=' doesn't...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gardella Geoffrey Gardella
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Zendesk Support

                    Time Tracking

                    Estimated:
                    Original Estimate - 2 days
                    2d
                    Remaining:
                    Remaining Estimate - 2 days
                    2d
                    Logged:
                    Time Spent - Not Specified
                    Not Specified