]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
node-proxy: rename System to BaseSystem
authorGuillaume Abrioux <gabrioux@ibm.com>
Fri, 16 Jun 2023 06:08:38 +0000 (08:08 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 14:51:51 +0000 (14:51 +0000)
In order to avoid confusion or redefinition issue with class System()
defined in server.py.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit 3bb2863d5ac14fbadd609cfb3c494acc3ba8c9f0)

src/cephadm/node-proxy/basesystem.py [new file with mode: 0644]
src/cephadm/node-proxy/redfish_system.py
src/cephadm/node-proxy/server-v2.py
src/cephadm/node-proxy/system.py [deleted file]

diff --git a/src/cephadm/node-proxy/basesystem.py b/src/cephadm/node-proxy/basesystem.py
new file mode 100644 (file)
index 0000000..8dcdecb
--- /dev/null
@@ -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()
index ffa530cefbf06a91ce160139db29568b505761c9..eb1f323acb2cbd364201e0254735f212d4de45ae 100644 (file)
@@ -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']
index d1924629e6bd0ff8e85ef1a73ba21ad904eca5ee..f4afba4daa11e0a37d2ec56226ab1266fae00fad 100644 (file)
@@ -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 (file)
index 9e8f97e..0000000
+++ /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()