From ab61ca0595661997a4d6421a6d3580a8b882f415 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Mon, 9 Mar 2020 15:00:20 -0500 Subject: [PATCH 1/2] Reverting PR#9954 until support for UCI is added in 5.11.5 --- cfme/fixtures/v2v_fixtures.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/cfme/fixtures/v2v_fixtures.py b/cfme/fixtures/v2v_fixtures.py index 9634cca88d..21fab5e00c 100644 --- a/cfme/fixtures/v2v_fixtures.py +++ b/cfme/fixtures/v2v_fixtures.py @@ -214,7 +214,20 @@ def vddk_url(): def get_conversion_data(appliance, target_provider): if target_provider.one_of(RHEVMProvider): - if appliance.version < '5.11': + # Support for UCI hosts for RHV would be added in 5.11.5. + # So, this if block should be disabled until then. + if appliance.version >= '5.11.5': + resource_type = "ManageIQ::Providers::Redhat::InfraManager::Vm" + vm_key = conf.credentials[ + target_provider.data["private-keys"]["engine-rsa"]["credentials"]] + auth_user = vm_key.username + private_key = vm_key.password + try: + hosts = target_provider.data["conversion_instances"] + except KeyError: + pytest.skip("No conversion host on provider") + + else: resource_type = "ManageIQ::Providers::Redhat::InfraManager::Host" engine_key = conf.credentials[target_provider.data["ssh_creds"]] auth_user = engine_key.username @@ -230,17 +243,6 @@ def get_conversion_data(appliance, target_provider): except KeyError: pytest.skip("No conversion host on provider") - elif appliance.version > '5.10': - resource_type = "ManageIQ::Providers::Redhat::InfraManager::Vm" - vm_key = conf.credentials[ - target_provider.data["private-keys"]["engine-rsa"]["credentials"]] - auth_user = vm_key.username - private_key = vm_key.password - try: - hosts = target_provider.data["conversion_instances"] - except KeyError: - pytest.skip("No conversion host on provider") - else: resource_type = "ManageIQ::Providers::Openstack::CloudManager::Vm" instance_key = conf.credentials[ @@ -265,7 +267,7 @@ def set_conversion_host_api( """ Setting conversion host for RHV and OSP provider via REST - Note: Support for using VM as UCI conversion hosts was added for RHV in 5.11.4. + Note: Support for using VM as UCI conversion hosts will be added for RHV in 5.11.5. """ vmware_ssh_private_key = None vmware_vddk_package_url = None @@ -286,9 +288,9 @@ def set_conversion_host_api( for host in conversion_data["hosts"]: conversion_entity = ( - "hosts" - if target_provider.one_of(RHEVMProvider) and appliance.version < '5.11' - else "vms" + "vms" + if target_provider.one_of(RHEVMProvider) and appliance.version >= '5.11.5' + else "hosts" ) host_id = ( getattr(appliance.rest_api.collections, conversion_entity).filter( From 876d74bd8e02e137eca52f667697ca7e49633632 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Mon, 9 Mar 2020 15:29:59 -0500 Subject: [PATCH 2/2] Reverting few changes made through PR#9954 --- cfme/fixtures/v2v_fixtures.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cfme/fixtures/v2v_fixtures.py b/cfme/fixtures/v2v_fixtures.py index 21fab5e00c..f36ff13137 100644 --- a/cfme/fixtures/v2v_fixtures.py +++ b/cfme/fixtures/v2v_fixtures.py @@ -215,7 +215,6 @@ def vddk_url(): def get_conversion_data(appliance, target_provider): if target_provider.one_of(RHEVMProvider): # Support for UCI hosts for RHV would be added in 5.11.5. - # So, this if block should be disabled until then. if appliance.version >= '5.11.5': resource_type = "ManageIQ::Providers::Redhat::InfraManager::Vm" vm_key = conf.credentials[ @@ -267,7 +266,7 @@ def set_conversion_host_api( """ Setting conversion host for RHV and OSP provider via REST - Note: Support for using VM as UCI conversion hosts will be added for RHV in 5.11.5. + Note: Support for using VMs as UCI conversion hosts will be added for RHV in 5.11.5. """ vmware_ssh_private_key = None vmware_vddk_package_url = None