Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift fog-vcloud-director version to 0.3.0 #321

Merged
merged 1 commit into from
Sep 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/manageiq/providers/vmware/manager_auth_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def raw_connect(server, port, username, password, api_version = '5.5', validate
}
}

connect = Fog::Compute::VcloudDirector.new(params)
connect = Fog::VcloudDirector::Compute.new(params)
connection_rescue_block { validate_connection(connect) } if validate
connect
end
Expand All @@ -70,7 +70,7 @@ def connection_rescue_block

def translate_exception(err)
case err
when Fog::Compute::VcloudDirector::Unauthorized
when Fog::VcloudDirector::Compute::Unauthorized
MiqException::MiqInvalidCredentialsError.new "Login failed due to a bad username or password."
when Excon::Errors::Timeout
MiqException::MiqUnreachableError.new "Login attempt timed out"
Expand Down
3 changes: 1 addition & 2 deletions manageiq-providers-vmware.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Gem::Specification.new do |s|

s.files = Dir["{app,config,lib}/**/*"]

s.add_dependency("fog-vcloud-director", ["~> 0.2.2"])
s.add_dependency "fog-core", "~>1.40"
s.add_dependency("fog-vcloud-director", ["~> 0.3.0"])
s.add_dependency "vmware_web_service", "~>0.3.0"
s.add_dependency "rbvmomi", "~>1.13.0"

Expand Down
8 changes: 4 additions & 4 deletions spec/models/manageiq/providers/vmware/cloud_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@

it "decrypts the vcloud password" do
encrypted = MiqPassword.encrypt("encrypted")
expect(::Fog::Compute::VcloudDirector).to receive(:new).with(params)
expect(::Fog::VcloudDirector::Compute).to receive(:new).with(params)

described_class.raw_connect("server", "port", "username", encrypted, "api_version")
end

it "validates the password if validate is true if specified" do
expect(described_class).to receive(:validate_connection).and_raise(Fog::Compute::VcloudDirector::Unauthorized)
expect(::Fog::Compute::VcloudDirector).to receive(:new).with(params)
expect(described_class).to receive(:validate_connection).and_raise(Fog::VcloudDirector::Compute::Unauthorized)
expect(::Fog::VcloudDirector::Compute).to receive(:new).with(params)

expect do
described_class.raw_connect("server", "port", "username", "encrypted", "api_version", true)
Expand All @@ -68,7 +68,7 @@

it "does not validate the password unless specified" do
expect(described_class).to_not receive(:validate_connection)
expect(::Fog::Compute::VcloudDirector).to receive(:new).with(params)
expect(::Fog::VcloudDirector::Compute).to receive(:new).with(params)

described_class.raw_connect("server", "port", "username", "encrypted", "api_version")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
},
{
:name => 'error response',
:data => -> { raise Fog::Compute::VcloudDirector::Forbidden, 'simulated error' },
:data => -> { raise Fog::VcloudDirector::Compute::Forbidden, 'simulated error' },
:expected => []
}
].each do |test_case|
Expand All @@ -299,7 +299,7 @@
},
{
:name => 'error response',
:data => -> { raise Fog::Compute::VcloudDirector::Forbidden, 'simulated error' },
:data => -> { raise Fog::VcloudDirector::Compute::Forbidden, 'simulated error' },
:expected => []
}
].each do |test_case|
Expand Down