Hi.

I seem to have the following problem. This is a code from my custom type:

  newproperty(:kernel_options) do
    desc "Kernel options for installation boot."
    defaultto {}

    def insync?(is)
      # @should is an Array. see lib/puppet/type.rb insync?
      should = @should.first

      # if members of hashes are not the same, something
      # was added or removed from manifest, so return false
return false unless is.class == Hash and should.class == Hash and is.keys.sort == should.keys.sort
      # check if values of hash keys are equal
      is.each do |l,w|
        return false unless w == should[l]
      end
      true
    end

    def should_to_s(newvalue)
      newvalue.inspect
    end

    def is_to_s(currentvalue)
      currentvalue.inspect
    end
  end



But, if I change the system manually, and if kernel_options property is not set in my resource, then puppet doesn't change the system back to it's original values.

So, defaultto seems to be ignored. If I set kernel_options => {}
they are indeed obeyed and applied.


Any ideas why is this the case? defaultto works ok if I don't use the hash in my property, so I guess it's something to do with the is_to_s/should_to_s/insync overrides?


--
Jakov Sosic
www.srce.unizg.hr

--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to