The `raw_connect` method of providers is intended to check connection and authentication details. In particular it is called from the UI when the user clicks the `Validate` button in the form used to add a new provider. This method should report errors throwing instances of `MiqEVMLoginError`, `MiqInvalidCredentialsError`, etc. But the RHV provider only throws this kinds of errors when it uses version 3 of the API. The reason is that the code that throws those exceptions only catches the exceptions that are generated by the old `ovirt` gem, used for version 3 of the API, and not the ones that are generated by the new `ovirt-engine-sdk` gem, used for version 4 of the API. For example: def verify_credentials_for_rhevm(options = {}) with_provider_connection(options) { |connection| connection.test(true) } rescue SocketError, Errno::EHOSTUNREACH, Errno::ENETUNREACH _log.warn($ERROR_INFO) raise MiqException::MiqUnreachableError, $ERROR_INFO rescue MiqException::MiqUnreachableError => e raise e rescue RestClient::Unauthorized raise MiqException::MiqInvalidCredentialsError, "Incorrect user name or password." rescue _log.error("Error while verifying credentials #{$ERROR_INFO}") raise MiqException::MiqEVMLoginError, $ERROR_INFO end The result is not very serious, as the ManageIQ core catches all exceptions, and displays the message to the user anyhow. But it would be more consistent if it throws these standard exceptions: the messages displayed to the user would be the same when using version 3 and version 4 of the API.
PR https://github.com/ManageIQ/manageiq-providers-ovirt/pull/162
https://github.com/ManageIQ/manageiq-providers-ovirt/pull/188