[PATCH aeolus-conductor] BZ#796247 Update Credentials Check to use new DC Client Errors

Matt Wagner matt.wagner at redhat.com
Wed Feb 29 16:30:48 UTC 2012


On Thu, Feb 23, 2012 at 10:57:29AM +0000, mtaylor at redhat.com wrote:
> From: Martyn Taylor <mtaylor at redhat.com>
> 
> ---
>  src/app/models/provider_account.rb |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/app/models/provider_account.rb b/src/app/models/provider_account.rb
> index eff59f9..e53b4c6 100644
> --- a/src/app/models/provider_account.rb
> +++ b/src/app/models/provider_account.rb
> @@ -87,10 +87,12 @@ class ProviderAccount < ActiveRecord::Base
>  
>    def validate_credentials
>      begin
> -      unless valid_credentials?
> -        errors.add(:base, I18N.t('provider_accounts.errors.invalid_credentials'))
> -      end
> -    rescue
> +      valid_credentials?
> +    rescue DeltaCloud::HTTPError::Unauthorized => ue
> +      logger.debug("Unauthorized Error Rasied by Deltacloud: #{ue.inspect}")
> +      errors.add(:base, I18n.t('provider_accounts.errors.invalid_credentials'))
> +    rescue => e
> +      logger.error("Error validating credentials: #{e.inspect}")
>        errors.add(:base, I18n.t('provider_accounts.errors.exception_while_validating'))
>      end
>    end
> -- 
> 1.7.6.4

ACK, assuming you have run cukes/rspec on this.

The patch itself works for me as intended after upgrading Deltacloud.

Unfortunately, I upgraded Deltacloud by building a .gem and installing
that, which pulled in random updates to other packages, and now my
install is SUPER-crashy. After running about a dozen of the cucumber
steps, Deltacloud segfaults for me, never in a consistent place. Ergo I
cannot run automated tests against this, so I'm trusting that you
{have done|will do} so, in which case, ACK.

-- Matt



More information about the aeolus-devel mailing list