From 3f6c7e406af2e79c33e0c589a008bc94029dfa4f Mon Sep 17 00:00:00 2001 From: "Chandan Kumar (raukadah)" Date: Tue, 22 Apr 2025 18:16:44 +0530 Subject: [PATCH] Drop nova command reference from the code In DevStack environment, nova service-list command does not exist. Distro suggests to install python-novaclient from package. In Strategies documentation, we generate the docs from following code.[1] ``` * - ``migration`` - .. watcher-term:: watcher.applier.actions.migration.Migrate * - ``change_nova_service_state`` - .. watcher-term:: watcher.applier.actions.change_nova_service_state.ChangeNovaServiceState ``` and with in code, we use nova python binding to get list services[2] and we are not calling openstack cli reference with in the code. Documenting the equivalent openstack command does not seems to be useful in the help text as we are using python binding. Links: [1]. https://github.com/openstack/watcher/blob/c4acce91d6bb87b4ab865bc8e4d442a148dba1d5/doc/source/strategies/host_maintenance.rst?plain=1#L45 [2]. https://github.com/openstack/watcher/blob/c4acce91d6bb87b4ab865bc8e4d442a148dba1d5/watcher/common/nova_helper.py#L150-L152 Change-Id: I0c663c9741fae94bdb9c30f46d3d396325a33948 Signed-off-by: Chandan Kumar (raukadah) --- watcher/applier/actions/change_nova_service_state.py | 6 ++---- watcher/applier/actions/migration.py | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/watcher/applier/actions/change_nova_service_state.py b/watcher/applier/actions/change_nova_service_state.py index e7bea1e7f..c557a5a9b 100644 --- a/watcher/applier/actions/change_nova_service_state.py +++ b/watcher/applier/actions/change_nova_service_state.py @@ -39,10 +39,8 @@ class ChangeNovaServiceState(base.BaseAction): 'disabled_reason': str, }) - The `resource_id` references a nova-compute service name (list of available - nova-compute services is returned by this command: ``nova service-list - --binary nova-compute``). - The `state` value should either be `ONLINE` or `OFFLINE`. + The `resource_id` references a nova-compute service name. + The `state` value should either be `up` or `down`. The `disabled_reason` references the reason why Watcher disables this nova-compute service. The value should be with `watcher_` prefix, such as `watcher_disabled`, `watcher_maintaining`. diff --git a/watcher/applier/actions/migration.py b/watcher/applier/actions/migration.py index 781f378cd..d94bfaeda 100644 --- a/watcher/applier/actions/migration.py +++ b/watcher/applier/actions/migration.py @@ -47,9 +47,7 @@ class Migrate(base.BaseAction): The `resource_id` is the UUID of the server to migrate. The `source_node` and `destination_node` parameters are respectively the - source and the destination compute hostname (list of available compute - hosts is returned by this command: ``nova service-list --binary - nova-compute``). + source and the destination compute hostname. .. note::