puppetlabs/mcollective-plugins — pull request #14 by MaxMartin (2011-10-15 20:52:40+00:00)
Title: Change how the status of #create is checked

Previously, to check whether a resource creation succeeded, we only
checked the :ensure value of the resource returned by the
Puppet::Resource indirection#save; however, there are some cases where
resource creation will fail, but this :ensure value will still not be
:absent. Instead, we now check the status of the report returned by
Puppet (only in Puppet 2.7.6 or greater) to see what the status of the
catalog application was; this will also give us any error information we
might want to return to the client.

Also, the avoid_conflict key must be changed to a symbol when accessing
the value from the resources found on the system because
Puppet::Resource#to_pson_hash is indexed by symbol.

Paired-with: Matt Robinson