From: Samuel Just Date: Mon, 24 Nov 2025 17:29:55 +0000 (-0800) Subject: pybind/mgr: mechanically fix simple users to not import CLI*Command X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9099c682c2596612df7ab698e5ac3cfa578eb6d3;p=ceph.git pybind/mgr: mechanically fix simple users to not import CLI*Command The next commit will introduce module specific CLICommand classes. Signed-off-by: Samuel Just --- diff --git a/src/pybind/mgr/alerts/module.py b/src/pybind/mgr/alerts/module.py index 2374434aea7..5bd627471ea 100644 --- a/src/pybind/mgr/alerts/module.py +++ b/src/pybind/mgr/alerts/module.py @@ -3,7 +3,7 @@ A simple cluster health alerting module. """ -from mgr_module import CLIReadCommand, HandleCommandResult, MgrModule, Option +from mgr_module import HandleCommandResult, MgrModule, Option from email.utils import formatdate, make_msgid from threading import Event from typing import Any, Optional, Dict, List, TYPE_CHECKING, Union diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 1c6fa9415b1..78dfa011ef2 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -9,7 +9,7 @@ import json import math import random import time -from mgr_module import CLIReadCommand, CLICommand, CommandResult, MgrModule, Option, OSDMap, CephReleases +from mgr_module import CommandResult, MgrModule, Option, OSDMap, CephReleases from threading import Event from typing import cast, Any, Dict, List, Optional, Sequence, Tuple, Union from mgr_module import CRUSHMap diff --git a/src/pybind/mgr/crash/module.py b/src/pybind/mgr/crash/module.py index e9f78c81514..ed1cb63cdb4 100644 --- a/src/pybind/mgr/crash/module.py +++ b/src/pybind/mgr/crash/module.py @@ -1,5 +1,5 @@ import hashlib -from mgr_module import CLICommand, CLIReadCommand, CLIWriteCommand, MgrModule, Option +from mgr_module import MgrModule, Option import datetime import errno import functools diff --git a/src/pybind/mgr/devicehealth/module.py b/src/pybind/mgr/devicehealth/module.py index e90db88fd16..0a72e720d09 100644 --- a/src/pybind/mgr/devicehealth/module.py +++ b/src/pybind/mgr/devicehealth/module.py @@ -4,7 +4,7 @@ Device health monitoring import errno import json -from mgr_module import MgrModule, CommandResult, MgrModuleRecoverDB, CLIRequiresDB, CLICommand, CLIReadCommand, Option, MgrDBNotReady +from mgr_module import MgrModule, CommandResult, MgrModuleRecoverDB, CLIRequiresDB, Option, MgrDBNotReady import operator import rados import re diff --git a/src/pybind/mgr/feedback/module.py b/src/pybind/mgr/feedback/module.py index 95683912c09..59bd7a75674 100644 --- a/src/pybind/mgr/feedback/module.py +++ b/src/pybind/mgr/feedback/module.py @@ -7,7 +7,7 @@ See doc/mgr/feedback.rst for more info. from requests.exceptions import RequestException -from mgr_module import CLIReadCommand, HandleCommandResult, MgrModule +from mgr_module import HandleCommandResult, MgrModule import errno from .service import CephTrackerClient diff --git a/src/pybind/mgr/hello/module.py b/src/pybind/mgr/hello/module.py index d4b50f401fc..e7a7fc710b6 100644 --- a/src/pybind/mgr/hello/module.py +++ b/src/pybind/mgr/hello/module.py @@ -5,7 +5,7 @@ A hello world module See doc/mgr/hello.rst for more info. """ -from mgr_module import CLIReadCommand, HandleCommandResult, MgrModule, Option +from mgr_module import HandleCommandResult, MgrModule, Option from threading import Event from typing import cast, Any, Optional, TYPE_CHECKING import errno diff --git a/src/pybind/mgr/influx/module.py b/src/pybind/mgr/influx/module.py index 2d8c5c174b0..9735b71c658 100644 --- a/src/pybind/mgr/influx/module.py +++ b/src/pybind/mgr/influx/module.py @@ -8,7 +8,7 @@ import errno import time from typing import cast, Any, Dict, Iterator, List, Optional, Tuple, Union -from mgr_module import CLICommand, CLIReadCommand, CLIWriteCommand, MgrModule, Option, OptionValue +from mgr_module import MgrModule, Option, OptionValue try: from influxdb import InfluxDBClient diff --git a/src/pybind/mgr/insights/module.py b/src/pybind/mgr/insights/module.py index 4f1ad4ad6ca..1e82f3dc0ad 100644 --- a/src/pybind/mgr/insights/module.py +++ b/src/pybind/mgr/insights/module.py @@ -3,7 +3,7 @@ import json import re import threading -from mgr_module import CLICommand, CLIReadCommand, HandleCommandResult +from mgr_module import HandleCommandResult from mgr_module import MgrModule, CommandResult, NotifyType from . import health as health_util diff --git a/src/pybind/mgr/iostat/module.py b/src/pybind/mgr/iostat/module.py index b101094abc0..4ef8dbbb044 100644 --- a/src/pybind/mgr/iostat/module.py +++ b/src/pybind/mgr/iostat/module.py @@ -1,6 +1,6 @@ from typing import Any -from mgr_module import CLIReadCommand, HandleCommandResult, MgrModule +from mgr_module import HandleCommandResult, MgrModule class Module(MgrModule): diff --git a/src/pybind/mgr/mirroring/module.py b/src/pybind/mgr/mirroring/module.py index 2ea3e1b067c..01dfe301253 100644 --- a/src/pybind/mgr/mirroring/module.py +++ b/src/pybind/mgr/mirroring/module.py @@ -1,6 +1,6 @@ from typing import List, Optional -from mgr_module import MgrModule, CLIReadCommand, CLIWriteCommand, Option, NotifyType +from mgr_module import MgrModule, Option, NotifyType from .fs.snapshot_mirror import FSSnapshotMirror diff --git a/src/pybind/mgr/nfs/module.py b/src/pybind/mgr/nfs/module.py index ff67eba64f9..0b18988c181 100644 --- a/src/pybind/mgr/nfs/module.py +++ b/src/pybind/mgr/nfs/module.py @@ -3,7 +3,7 @@ import threading from typing import Tuple, Optional, List, Dict, Any import yaml -from mgr_module import MgrModule, CLICommand, Option, CLICheckNonemptyFileInput +from mgr_module import MgrModule, Option, CLICheckNonemptyFileInput import object_format import orchestrator from orchestrator.module import IngressType diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index e2daa2ed5f7..ad5ebc14d4e 100644 --- a/src/pybind/mgr/pg_autoscaler/module.py +++ b/src/pybind/mgr/pg_autoscaler/module.py @@ -8,7 +8,7 @@ import threading from typing import Any, Dict, List, Optional, Set, Tuple, TYPE_CHECKING, Union import uuid from prettytable import PrettyTable -from mgr_module import HealthChecksT, CLIReadCommand, CLIWriteCommand, CRUSHMap, MgrModule, Option, OSDMap +from mgr_module import HealthChecksT, CRUSHMap, MgrModule, Option, OSDMap """ Some terminology is made up for the purposes of this module: diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 836f64aa2b7..4e363bf10a9 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -11,7 +11,7 @@ from collections import namedtuple from collections import OrderedDict from tempfile import NamedTemporaryFile -from mgr_module import CLIReadCommand, MgrModule, MgrStandbyModule, PG_STATES, Option, ServiceInfoT, HandleCommandResult, CLIWriteCommand +from mgr_module import MgrModule, MgrStandbyModule, PG_STATES, Option, ServiceInfoT, HandleCommandResult from mgr_util import get_default_addr, profile_method, build_url, test_port_allocation, PortAlreadyInUse from orchestrator import OrchestratorClientMixin, raise_if_exception, OrchestratorError from rbd import RBD diff --git a/src/pybind/mgr/rbd_support/module.py b/src/pybind/mgr/rbd_support/module.py index 369face038a..6934905d813 100644 --- a/src/pybind/mgr/rbd_support/module.py +++ b/src/pybind/mgr/rbd_support/module.py @@ -11,7 +11,7 @@ import rbd import traceback from typing import cast, Any, Callable, Optional, Tuple, TypeVar -from mgr_module import CLIReadCommand, CLIWriteCommand, MgrModule, Option +from mgr_module import MgrModule, Option from threading import Thread, Event from .common import NotAuthorizedError diff --git a/src/pybind/mgr/rgw/module.py b/src/pybind/mgr/rgw/module.py index fd5f0f7ff48..d77eed2362c 100644 --- a/src/pybind/mgr/rgw/module.py +++ b/src/pybind/mgr/rgw/module.py @@ -8,7 +8,6 @@ import sys from mgr_module import ( MgrModule, - CLICommand, HandleCommandResult, Option, MonCommandFailed, diff --git a/src/pybind/mgr/selftest/module.py b/src/pybind/mgr/selftest/module.py index 2115c1da35e..a4e8f65476f 100644 --- a/src/pybind/mgr/selftest/module.py +++ b/src/pybind/mgr/selftest/module.py @@ -1,5 +1,5 @@ -from mgr_module import MgrModule, CommandResult, HandleCommandResult, CLICommand, Option +from mgr_module import MgrModule, CommandResult, HandleCommandResult, Option import enum import json import random diff --git a/src/pybind/mgr/snap_schedule/module.py b/src/pybind/mgr/snap_schedule/module.py index adf982448b1..7749af7b79b 100644 --- a/src/pybind/mgr/snap_schedule/module.py +++ b/src/pybind/mgr/snap_schedule/module.py @@ -8,7 +8,7 @@ import json import sqlite3 from typing import Any, Dict, Optional, Tuple, Union from .fs.schedule_client import SnapSchedClient -from mgr_module import MgrModule, CLIReadCommand, CLIWriteCommand, Option, NotifyType +from mgr_module import MgrModule, Option, NotifyType from mgr_util import CephfsConnectionException from threading import Event diff --git a/src/pybind/mgr/status/module.py b/src/pybind/mgr/status/module.py index d0026fd1ae2..02cc5db4b0c 100644 --- a/src/pybind/mgr/status/module.py +++ b/src/pybind/mgr/status/module.py @@ -11,7 +11,7 @@ import fnmatch import mgr_util import json -from mgr_module import CLIReadCommand, MgrModule, HandleCommandResult +from mgr_module import MgrModule, HandleCommandResult class Module(MgrModule): diff --git a/src/pybind/mgr/telegraf/module.py b/src/pybind/mgr/telegraf/module.py index 541ddba4f07..6467f8f8118 100644 --- a/src/pybind/mgr/telegraf/module.py +++ b/src/pybind/mgr/telegraf/module.py @@ -7,7 +7,7 @@ from threading import Event from telegraf.basesocket import BaseSocket from telegraf.protocol import Line -from mgr_module import CLICommand, CLIReadCommand, MgrModule, Option, OptionValue, PG_STATES +from mgr_module import MgrModule, Option, OptionValue, PG_STATES from typing import cast, Any, Dict, Iterable, Optional, Tuple from urllib.parse import urlparse diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 2885450fb85..148681ca022 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -20,7 +20,7 @@ from threading import Event, Lock from collections import defaultdict from typing import cast, Any, DefaultDict, Dict, List, Optional, Tuple, TypeVar, TYPE_CHECKING, Union -from mgr_module import CLICommand, CLIReadCommand, MgrModule, Option, OptionValue, ServiceInfoT +from mgr_module import MgrModule, Option, OptionValue, ServiceInfoT ALL_CHANNELS = ['basic', 'ident', 'crash', 'device', 'perf'] diff --git a/src/pybind/mgr/test_orchestrator/module.py b/src/pybind/mgr/test_orchestrator/module.py index 7e63eda86f7..701a6b9f90c 100644 --- a/src/pybind/mgr/test_orchestrator/module.py +++ b/src/pybind/mgr/test_orchestrator/module.py @@ -16,7 +16,7 @@ except ImportError: from ceph.deployment import inventory from ceph.deployment.drive_group import DriveGroupSpec -from mgr_module import CLICommand, HandleCommandResult +from mgr_module import HandleCommandResult from mgr_module import MgrModule import orchestrator