[PATCH] added mapping for Deltacloud instance state stopping to Instance::STATE_SHUTTING_DOWN
Jan Provaznik
jprovazn at redhat.com
Thu Aug 30 08:33:19 UTC 2012
On 08/29/2012 03:27 PM, Tomáš Hrčka wrote:
> ---
> src/app/util/taskomatic.rb | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/app/util/taskomatic.rb b/src/app/util/taskomatic.rb
> index 1708970..44f6707 100644
> --- a/src/app/util/taskomatic.rb
> +++ b/src/app/util/taskomatic.rb
> @@ -116,6 +116,8 @@ module Taskomatic
> return Instance::STATE_STOPPED
> when 'SHUTTING_DOWN'
> return Instance::STATE_SHUTTING_DOWN
> + when 'STOPPING'
> + return Instance::STATE_SHUTTING_DOWN
> else
> return Instance::STATE_PENDING
> end
>
Could you please add more descriptive commit log?
To sum it up: the problem is that dc-api returns state 'stopping'
instead of 'shutting_down' since version 1.0. So if we want to keep
compatibility both with 0.5.x (which is in RHEL) and 1.0 (which is in
F17 and upstream), we have to support both states.
First option would be to add STATE_STOPPING as regular instance state,
but this change seems to be too invasive in pre-1.1 state.
Other options is to convert stopping state into shutting down as you do
in the patch above - this seems safer to me at this point. The patch
above works almost fine, but shutting_down state should be also
translated to stopping when sending this state to dc-core - this happens
in app/models/instance_task.rb self.valid_actions_for_instance_state method
shutting_down state in this method should be converted back to stopping
state for dc-api with version >1.
Jan
More information about the aeolus-devel
mailing list