deltacloud/deltacloud-core — pull request #47 by marios (2013-06-07 08:37:11+00:00)
Title: Delinger pull 44

This is a follow on from David's [pull request #44](https://github.com/deltacloud/deltacloud-core/pull/44). The cleanest/quickest way I could think of adding to that while keeping David's authorship info was to just open a new pull.

I see 2 problems with the changes made by David - both of which are caused by the transformation of the instance state machine from 'root_store' to 'ebs' style ec2 instances:

1. instance_states collection reported for EC2 instances won't be always correct
2. the actions reported for a given instance won't always be correct.

For 2. - could override the instance_actions_for method for the ec2 driver - which is what I'm doing with this last commit here... this is a quick fix and I'm sure there is a more elegant solution - ideally involving a change in the way the state_machine works in /models/state_machine.rb (like addition of conditionals but this is by no means simple as the current model is evaluated at driver load time, not at run time per instance... afaik).

I would appreciate some more testing of this (like fire up a root_store and ebs instance and check that the instance actions (e.g. via the xml/json serializations) are reported correctly when the instance is running/stopping etc).

marios