Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Temporary Bugfix for adding providers.

This needs to be addressed better later on, but for some reason, the
previously commited code is not working as expected for checking if a
provider has the correct name entered in conductor.  For Ec2 example,
this would verify that, say, 'us-east-1' is valid.  Currently, this
returns a 500 saying 'aws requires authorization for this request'.
Yet when I run the same command directly against the dc client in a
rails console, it works as expected.  This is just a validation, so
I propose just disabling it for now, in the interest of being able to
have an end-of-sprint minor release.  This can be revisited in the
near future.
  • Loading branch information...
commit a1fde112c7e735f8b809aed283b622393f7a9c81 1 parent 708a82d
@jguiditta jguiditta authored rwsu committed
Showing with 2 additions and 10 deletions.
  1. +2 −2 src/app/models/provider.rb
  2. +0 −8 src/spec/models/provider_spec.rb
View
4 src/app/models/provider.rb
@@ -264,7 +264,7 @@ def stoppable_instances
def validate_provider
if !nil_or_empty(url)
errors.add("url", I18n.t("activerecord.errors.provider.url")) unless valid_framework?
- errors.add("deltacloud_provider", I18n.t("activerecord.errors.provider.deltacloud_provider")) unless valid_provider?
+ #errors.add("deltacloud_provider", I18n.t("activerecord.errors.provider.deltacloud_provider")) unless valid_provider?
end
end
@@ -278,7 +278,7 @@ def valid_provider?
if !nil_or_empty(deltacloud_provider)
client = connect
return false if client.nil?
- return false unless client.valid_provider? deltacloud_provider
+ return false unless client.driver(provider_type.deltacloud_driver).valid_provider? deltacloud_provider
end
true
end
View
8 src/spec/models/provider_spec.rb
@@ -65,14 +65,6 @@
@provider.should_not be_valid
end
- it "should set error if unable to connect to specified deltacloud_provider" do
- @provider.stub(:valid_provider?).and_return(false)
- @provider.stub(:valid_framework?).and_return(true)
- @provider.should have(1).error_on(:deltacloud_provider)
- @provider.errors[:deltacloud_provider].first.should eql(I18n.t("activerecord.errors.provider.deltacloud_provider"))
- @provider.should_not be_valid
- end
-
it "should require unique name" do
@provider.save!
provider2 = Factory.build :mock_provider
Please sign in to comment.
Something went wrong with that request. Please try again.