crowbar/barclamp-crowbar — pull request #589 by vuntz (2013-07-09 17:10:02+00:00)
Title: Allow passing an incomplete json when creating a proposal

Until now, when creating a proposal with some existing json, it was
required that the json contained a full proposal definition. Two big
downsides of this are:

a) it's easy to break stuff by accident when changing a proposal
b) if the schema changes to add new mandatory attributes, people can
not simply re-use old json they had around; they have to update them

This commit allows passing an incomplete json with only a subset of
attributes. It will take the default json, and overwrite any attribute
there with the ones from the incomplete json.

Note that this is note using Chef::Mixin::DeepMerge::deep_merge! as a
deep merge is also merging arrays in attribute values, which is
something not desired here. The hash_only_merge! API is actually
available in Chef 11 in Chef::Mixin::DeepMerge, so this is just a
backport.

For all that matters, this is backwards-compatible.