[PATCH conductor] BZ #791123 catch deltacloud exceptions in dbomatic

Jan Provaznik jprovazn at redhat.com
Tue Mar 6 09:10:16 UTC 2012


On 03/05/2012 10:10 PM, Mo Morsi wrote:
> ---
>   src/dbomatic/dbomatic |    8 +++++++-
>   1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/src/dbomatic/dbomatic b/src/dbomatic/dbomatic
> index 7258730..fbe301d 100755
> --- a/src/dbomatic/dbomatic
> +++ b/src/dbomatic/dbomatic
> @@ -193,7 +193,13 @@ def check_one_account(account)
>       # optimization; right now we ignore instances that are in the STOPPED state.
>       # when we get to stateful instances, this will need to change
>       if instance.state != Instance::STATE_NEW and instance.state != Instance::STATE_STOPPED
> -      api_instance = connection.instance(instance.external_key)
> +      begin
> +        api_instance = connection.instance(instance.external_key)
> +      rescue Exception =>  e
> +        DBomaticLogger.instance.warn("caught deltacloud exception #{e} when updating instance #{instance.name}")
> +        api_instance = nil
> +      end
> +
>         if api_instance
>           DBomaticLogger.instance.info("updating instance state for #{instance.name}: #{instance.external_key}")
>           instance.state = Taskomatic.dcloud_to_instance_state(api_instance.state)

ACK



More information about the aeolus-devel mailing list