]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
node-proxy: add 'vendor based' redfish system selection
authorGuillaume Abrioux <gabrioux@ibm.com>
Fri, 30 Jan 2026 14:12:14 +0000 (15:12 +0100)
committerGuillaume Abrioux <gabrioux@ibm.com>
Wed, 18 Feb 2026 08:52:38 +0000 (09:52 +0100)
This commit adds REDFISH_SYSTEM_CLASSES registry (generic, dell, ...),
this way the user can choose a system class.

The default value is BaseRedfishSystem (generic) when vendor isn't specified.

Fixes: https://tracker.ceph.com/issues/74749
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/ceph-node-proxy/ceph_node_proxy/main.py
src/ceph-node-proxy/ceph_node_proxy/util.py

index 9a449ecf884568e244b080e9e016b599c9174883..e37996a4cc8f9cc7d286fae6901fbfc966757e54 100644 (file)
@@ -1,9 +1,11 @@
-from ceph_node_proxy.redfishdellsystem import RedfishDellSystem
 from ceph_node_proxy.api import NodeProxyApi
+from ceph_node_proxy.atollon import AtollonSystem
+from ceph_node_proxy.baseredfishsystem import BaseRedfishSystem
+from ceph_node_proxy.redfishdellsystem import RedfishDellSystem
 from ceph_node_proxy.reporter import Reporter
 from ceph_node_proxy.util import Config, get_logger, http_req, write_tmp_file, CONFIG
 from urllib.error import HTTPError
-from typing import Dict, Any, Optional
+from typing import Dict, Any, Optional, Type
 
 import argparse
 import os
@@ -13,6 +15,13 @@ import time
 import signal
 
 
+REDFISH_SYSTEM_CLASSES: Dict[str, Type[BaseRedfishSystem]] = {
+    'generic': BaseRedfishSystem,
+    'dell': RedfishDellSystem,
+    'atollon': AtollonSystem,
+}
+
+
 class NodeProxyManager:
     def __init__(self, **kw: Any) -> None:
         self.exc: Optional[Exception] = None
@@ -76,11 +85,13 @@ class NodeProxyManager:
             self.log.warning('No oob details could be loaded, exiting...')
             raise SystemExit(1)
         try:
-            self.system = RedfishDellSystem(host=oob_details['host'],
-                                            port=oob_details['port'],
-                                            username=oob_details['username'],
-                                            password=oob_details['password'],
-                                            config=self.config)
+            vendor = getattr(self.config, 'system', {}).get('vendor', 'generic')
+            system_cls = REDFISH_SYSTEM_CLASSES.get(vendor, BaseRedfishSystem)
+            self.system = system_cls(host=oob_details['host'],
+                                     port=oob_details['port'],
+                                     username=oob_details['username'],
+                                     password=oob_details['password'],
+                                     config=self.config)
             self.system.start()
         except RuntimeError:
             self.log.error("Can't initialize the redfish system.")
index c6af0304b92360a0256c321aa77ea3d52a7c04b3..bcee6171a99fd21d07a647f9d5065fb56616cae4 100644 (file)
@@ -19,7 +19,8 @@ CONFIG: Dict[str, Any] = {
         'endpoint': 'https://%(mgr_host):%(mgr_port)/node-proxy/data',
     },
     'system': {
-        'refresh_interval': 5
+        'refresh_interval': 5,
+        'vendor': 'generic',
     },
     'api': {
         'port': 9456,