rackspace/pyrax — pull request #220 by radeex (2013-10-16 04:29:44+00:00)
Title: [autoscale] Implement new "replace" methods

This branch introduces the following methods on the autoscale client and manager objects:

replace - replaces all data in a group config
replace_launch_config - replaces all data in a launch config
replace_policy - replaces all data in a scaling policy
replace_webhook - replaces all data in a webhook

These are necessary because the update* methods don't have a way to completely replace all properties -- specifically, if there's an optional property, the update methods have no way to DELETE that property.

The use of RSAS in Heat involves maintaining the desired state of all the autoscale objects externally (in the Heat template) and updating (replacing) them entirely when anything changes, so these methods will make that possible.

Additionally I fixed the update_launch_config handling of "key_name" and update_policy handling of "args" to match the existing behavior -- when I originally implemented them I did not make them take the value from the existing object.

I'm open to alternative designs, but right now I don't think there's any way in pyrax for me to do this.