[PATCH conductor] Don't send blank deltacloud_provider to Deltacloud

Matt Wagner matt.wagner at redhat.com
Thu May 17 19:24:27 UTC 2012


I encountered a bug while working with someone on IRC, in which
their provider's deltacloud_provider was an empty string, which
is "true" but not what we wanted to check.
---
 src/app/models/provider_account.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/app/models/provider_account.rb b/src/app/models/provider_account.rb
index 7fbc584..dd3d47d 100644
--- a/src/app/models/provider_account.rb
+++ b/src/app/models/provider_account.rb
@@ -183,7 +183,7 @@ class ProviderAccount < ActiveRecord::Base
       return false
     end
       opts = {:driver => provider.provider_type.deltacloud_driver }
-      opts[:provider] = provider.deltacloud_provider if provider.deltacloud_provider
+      opts[:provider] = provider.deltacloud_provider if provider.deltacloud_provider.present?
     DeltaCloud::valid_credentials?(credentials_hash['username'].to_s,
                                    credentials_hash['password'].to_s,
                                    provider.url,
-- 
1.7.7.6




More information about the aeolus-devel mailing list