Description of problem: When a RHEV provider is added and "Relationships and Power States" are not refreshed, it's not possible to access the provider using REST API. It fails with `NoMethodError: undefined method `>=' for nil:NilClass`. Please see http://pastebin.test.redhat.com/479296 for relevant parts of the evm.log Version-Release number of selected component (if applicable): 5.8.0.11-beta2 How reproducible: Very Steps to Reproduce: 1. add the RHEV provider using "Discover Infrastructure Providers" (this way it's not necessary to specify credentials and the provider is not refreshed automatically) 2. GET /api/providers/:id Actual results: NoMethodError: undefined method `>=' for nil:NilClass"
Created attachment 1274594 [details] Excerpt of evm.log Copying the log from the pastebin link as an attachment to ensure preservation of the data.
This happens when the provider is added without credentials because without credentials there is no way to determine the version of the API, therefore the 'api_version' method returns 'nil'. This was detected already as a problem that happens when the refresh hasn't been performed yet. The solution already merged to the new 'manageiq-providers-ovirt' repository: Renderer fails when calling validate_import_vm https://github.com/ManageIQ/manageiq-providers-ovirt/pull/3 But it was marked as fine/no. The corresponding pull request before the creation of the new repository was never merged either: Prevent NoMethodError when api_version is nil in VmImport https://github.com/ManageIQ/manageiq/pull/14013 So I think we should consider setting the flag to 'fine/yes', and backport it.
Here is the backport to fine: https://github.com/ManageIQ/manageiq/pull/14934
Moving qe_test_coverage to + as this bug is already included in existing RHV provider crud test.
Verified on CFME-5.9.0.4/RHV-4.1.7 Followed description's flow: 1. add the RHEV provider using "Discover Infrastructure Providers" (this way it's not necessary to specify credentials and the provider is not refreshed automatically) 2. GET /api/providers/:id - successful.