831: def propertychanges(currentvalues)
832:
833:
834: changes = []
835: ensureparam = @parameters[:ensure]
836:
837:
838:
839: ensureparam = nil unless ensureparam.is_a?(Puppet::Property)
840: if ensureparam && !currentvalues.include?(ensureparam)
841: raise Puppet::DevError, "Parameter ensure defined but missing from current values"
842: end
843:
844: if ensureparam and ! ensureparam.insync?(currentvalues[ensureparam])
845: changes << Puppet::Transaction::Change.new(ensureparam, currentvalues[ensureparam])
846:
847:
848: elsif ensureparam and currentvalues[ensureparam] == :absent
849: return []
850: else
851: changes = properties().find_all { |property|
852: currentvalues[property] ||= :absent
853: ! property.insync?(currentvalues[property])
854: }.collect { |property|
855: Puppet::Transaction::Change.new(property, currentvalues[property])
856: }
857: end
858:
859: if Puppet[:debug] and changes.length > 0
860: self.debug("Changing " + changes.collect { |ch| ch.property.name }.join(","))
861: end
862:
863: changes
864: end