From: Guillaume Abrioux Date: Fri, 16 Jun 2023 06:08:38 +0000 (+0200) Subject: node-proxy: rename System to BaseSystem X-Git-Tag: v19.3.0~102^2~87 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3bb2863d5ac14fbadd609cfb3c494acc3ba8c9f0;p=ceph.git node-proxy: rename System to BaseSystem In order to avoid confusion or redefinition issue with class System() defined in server.py. Signed-off-by: Guillaume Abrioux --- diff --git a/src/cephadm/node-proxy/basesystem.py b/src/cephadm/node-proxy/basesystem.py new file mode 100644 index 000000000000..8dcdecbc3a74 --- /dev/null +++ b/src/cephadm/node-proxy/basesystem.py @@ -0,0 +1,32 @@ +from util import Config +from typing import Dict, Any + + +class BaseSystem: + def __init__(self, **kw: Any) -> None: + self._system: Dict = {} + self.config: Config = kw['config'] + + def get_system(self) -> Dict[str, Dict[str, Dict]]: + raise NotImplementedError() + + def get_status(self) -> Dict[str, Dict[str, Dict]]: + raise NotImplementedError() + + def get_metadata(self) -> Dict[str, Dict[str, Dict]]: + raise NotImplementedError() + + def get_processors(self) -> Dict[str, Dict[str, Dict]]: + raise NotImplementedError() + + def get_memory(self) -> Dict[str, Dict[str, Dict]]: + raise NotImplementedError() + + def get_power(self) -> Dict[str, Dict[str, Dict]]: + raise NotImplementedError() + + def get_network(self) -> Dict[str, Dict[str, Dict]]: + raise NotImplementedError() + + def get_storage(self) -> Dict[str, Dict[str, Dict]]: + raise NotImplementedError() diff --git a/src/cephadm/node-proxy/redfish_system.py b/src/cephadm/node-proxy/redfish_system.py index ffa530cefbf0..eb1f323acb2c 100644 --- a/src/cephadm/node-proxy/redfish_system.py +++ b/src/cephadm/node-proxy/redfish_system.py @@ -1,4 +1,4 @@ -from system import System +from basesystem import BaseSystem from redfish_client import RedFishClient from threading import Thread, Lock from time import sleep @@ -8,7 +8,7 @@ from typing import Dict, Any log = Logger(__name__) -class RedfishSystem(System): +class RedfishSystem(BaseSystem): def __init__(self, **kw: Any) -> None: super().__init__(**kw) self.host: str = kw['host'] diff --git a/src/cephadm/node-proxy/server-v2.py b/src/cephadm/node-proxy/server-v2.py index d1924629e6bd..f4afba4daa11 100644 --- a/src/cephadm/node-proxy/server-v2.py +++ b/src/cephadm/node-proxy/server-v2.py @@ -3,6 +3,7 @@ from redfish_dell import RedfishDell from reporter import Reporter from util import Config, Logger from typing import Dict +from basesystem import BaseSystem import sys # for devel purposes diff --git a/src/cephadm/node-proxy/system.py b/src/cephadm/node-proxy/system.py deleted file mode 100644 index 9e8f97ef59d6..000000000000 --- a/src/cephadm/node-proxy/system.py +++ /dev/null @@ -1,32 +0,0 @@ -from util import Config -from typing import Dict, Any - - -class System: - def __init__(self, **kw: Any) -> None: - self._system: Dict = {} - self.config: Config = kw['config'] - - def get_system(self) -> Dict[str, Dict[str, Dict]]: - raise NotImplementedError() - - def get_status(self) -> Dict[str, Dict[str, Dict]]: - raise NotImplementedError() - - def get_metadata(self) -> Dict[str, Dict[str, Dict]]: - raise NotImplementedError() - - def get_processors(self) -> Dict[str, Dict[str, Dict]]: - raise NotImplementedError() - - def get_memory(self) -> Dict[str, Dict[str, Dict]]: - raise NotImplementedError() - - def get_power(self) -> Dict[str, Dict[str, Dict]]: - raise NotImplementedError() - - def get_network(self) -> Dict[str, Dict[str, Dict]]: - raise NotImplementedError() - - def get_storage(self) -> Dict[str, Dict[str, Dict]]: - raise NotImplementedError()