From 40fbd817efd7dc25659c4086fe83072b30539853 Mon Sep 17 00:00:00 2001 From: Danylo Kholodov Date: Sat, 12 Jan 2019 19:37:15 +0200 Subject: [PATCH] Fixing infra_hosts_power_tests for the CFME --- cfme/infrastructure/host.py | 5 ++++- .../openstack/infrastructure/test_host_power_control.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cfme/infrastructure/host.py b/cfme/infrastructure/host.py index e773ed7762..24df72d46a 100644 --- a/cfme/infrastructure/host.py +++ b/cfme/infrastructure/host.py @@ -660,7 +660,10 @@ def step(self): try: self.prerequisite_view.navigation.select("Compute", "Infrastructure", "Hosts") except NoSuchElementException: - self.prerequisite_view.navigation.select("Compute", "Infrastructure", "Nodes") + try: + self.prerequisite_view.navigation.select("Compute", "Infrastructure", "Nodes") + except NoSuchElementException: + self.prerequisite_view.navigation.select("Compute", "Infrastructure", "Hosts / Nodes") @navigator.register(Host) diff --git a/cfme/tests/openstack/infrastructure/test_host_power_control.py b/cfme/tests/openstack/infrastructure/test_host_power_control.py index 7cbb61fb0f..d02074f3d2 100644 --- a/cfme/tests/openstack/infrastructure/test_host_power_control.py +++ b/cfme/tests/openstack/infrastructure/test_host_power_control.py @@ -17,9 +17,9 @@ def host_collection(appliance): @pytest.fixture(scope='module') -def host_on(host_collection, provider): +def host_on(host_collection): try: - my_host_on = provider.nodes.all().pop() + my_host_on = host_collection.all().pop() except IndexError: assert False, "Missing nodes in provider's details" @@ -30,9 +30,9 @@ def host_on(host_collection, provider): @pytest.fixture(scope='module') -def host_off(host_collection, provider): +def host_off(host_collection): try: - my_host_off = provider.nodes.all().pop() + my_host_off = host_collection.all().pop() except IndexError: assert False, "Missing nodes in provider's details"