Skip to content

Commit

Permalink
verify credentials in raw connect
Browse files Browse the repository at this point in the history
  • Loading branch information
Jillian Tullo committed Aug 30, 2017
1 parent fd5b6b9 commit 201ec4a
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions app/models/manageiq/providers/vmware/infra_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,26 +121,9 @@ def stop_control_monitor
end

def verify_credentials(auth_type = nil, _options = {})
raise "no credentials defined" if self.missing_credentials?(auth_type)

begin
self.class.validate_connection do
with_provider_connection(:use_broker => false, :auth_type => auth_type) {}
rescue SocketError, Errno::EHOSTUNREACH, Errno::ENETUNREACH
_log.warn($!.inspect)
raise MiqException::MiqUnreachableError, $!.message
rescue Handsoap::Fault
_log.warn($!.inspect)
if $!.respond_to?(:reason)
raise MiqException::MiqInvalidCredentialsError, $!.reason if $!.reason =~ /Authorize Exception|incorrect user name or password/
raise $!.reason
end
raise $!.message
rescue Exception
_log.warn($!.inspect)
raise "Unexpected response returned from #{ui_lookup(:table => "ext_management_systems")}, see log for details"
end

true
end

def reset_vim_cache
Expand Down

0 comments on commit 201ec4a

Please sign in to comment.