diff options
author | Zuul <zuul@review.opendev.org> | 2023-03-09 18:41:42 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-03-09 18:41:42 +0000 |
commit | 373be3db5b7b058767ddac50ff1367725c932a84 (patch) | |
tree | c548600465378abdc07ff0238b83ac0be2de830f | |
parent | 8de4377fa0102d29805e6be7b08d8fce7b03b82e (diff) | |
parent | 37fa501cacdf4807582b677c92bd61013d477e2a (diff) | |
download | nova-373be3db5b7b058767ddac50ff1367725c932a84.tar.gz |
Merge "fup for power management series"
-rw-r--r-- | nova/tests/functional/libvirt/test_power_manage.py | 6 | ||||
-rw-r--r-- | nova/virt/libvirt/cpu/__init__.py | 22 | ||||
-rw-r--r-- | nova/virt/libvirt/driver.py | 2 |
3 files changed, 4 insertions, 26 deletions
diff --git a/nova/tests/functional/libvirt/test_power_manage.py b/nova/tests/functional/libvirt/test_power_manage.py index fb1ac7d0cd..9f80446bd6 100644 --- a/nova/tests/functional/libvirt/test_power_manage.py +++ b/nova/tests/functional/libvirt/test_power_manage.py @@ -21,7 +21,7 @@ from nova.tests import fixtures as nova_fixtures from nova.tests.fixtures import libvirt as fakelibvirt from nova.tests.functional.libvirt import base from nova.virt import hardware -from nova.virt.libvirt import cpu +from nova.virt.libvirt.cpu import api as cpu_api class PowerManagementTestsBase(base.ServersTestBase): @@ -73,7 +73,7 @@ class PowerManagementTestsBase(base.ServersTestBase): def _assert_cpu_set_state(self, cpu_set, expected='online'): for i in cpu_set: - core = cpu.Core(i) + core = cpu_api.Core(i) if expected == 'online': self.assertTrue(core.online, f'{i} is not online') elif expected == 'offline': @@ -212,7 +212,7 @@ class PowerManagementTestsGovernor(PowerManagementTestsBase): def test_changing_strategy_fails(self): # Arbitratly set a core governor strategy to be performance - cpu.Core(1).set_high_governor() + cpu_api.Core(1).set_high_governor() # and then forget about it while changing the strategy. self.flags(cpu_power_management_strategy='cpu_state', group='libvirt') # This time, this wouldn't be acceptable as some core would have a diff --git a/nova/virt/libvirt/cpu/__init__.py b/nova/virt/libvirt/cpu/__init__.py index 4410a4e579..e69de29bb2 100644 --- a/nova/virt/libvirt/cpu/__init__.py +++ b/nova/virt/libvirt/cpu/__init__.py @@ -1,22 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from nova.virt.libvirt.cpu import api - - -Core = api.Core - - -power_up = api.power_up -power_down = api.power_down -validate_all_dedicated_cpus = api.validate_all_dedicated_cpus -power_down_all_dedicated_cpus = api.power_down_all_dedicated_cpus diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 510dfdf38f..73134d8391 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -114,7 +114,7 @@ from nova.virt.image import model as imgmodel from nova.virt import images from nova.virt.libvirt import blockinfo from nova.virt.libvirt import config as vconfig -from nova.virt.libvirt import cpu as libvirt_cpu +from nova.virt.libvirt.cpu import api as libvirt_cpu from nova.virt.libvirt import designer from nova.virt.libvirt import event as libvirtevent from nova.virt.libvirt import guest as libvirt_guest |