]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: use full device path for blinking lights (if available) 32261/head
authorSage Weil <sage@redhat.com>
Sun, 15 Dec 2019 16:36:51 +0000 (10:36 -0600)
committerSage Weil <sage@redhat.com>
Fri, 20 Dec 2019 13:07:04 +0000 (07:07 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/tests/test_cephadm.py
src/pybind/mgr/orchestrator.py

index 550c07c6247178a8461c467b6617a8f18a34501d..78b7edb117b1718831af3aab0ab159509fc8e29a 100644 (file)
@@ -902,13 +902,13 @@ class CephadmOrchestrator(MgrModule, orchestrator.Orchestrator):
 
     def blink_device_light(self, ident_fault, on, locs):
         @async_map_completion
-        def blink(host, dev):
+        def blink(host, dev, path):
             cmd = [
                 'lsmcli',
                 'local-disk-%s-led-%s' % (
                     ident_fault,
                     'on' if on else 'off'),
-                '--path', dev,
+                '--path', path or dev,
             ]
             out, err, code = self._run_cephadm(
                 host, 'osd', 'shell', ['--'] + cmd,
index c93353d5bd8e528fcd5cb92b0518d81fdec296cc..6cda1902dc525a048c451c6ddc447ff049ae13fb 100644 (file)
@@ -211,5 +211,5 @@ class TestCephadm(object):
     @mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
     def test_blink_device_light(self, _send_command, _get_connection, cephadm_module):
         with self._with_host(cephadm_module, 'test'):
-            c = cephadm_module.blink_device_light('ident', True, [('test', '')])
+            c = cephadm_module.blink_device_light('ident', True, [('test', '', '')])
             assert self._wait(cephadm_module, c) == ['Set ident light for test: on']
index 27d3b8f3d35bf831d00f1ae179e68a702cafe25b..4d4b672d0c66fc91c1cbf82eed77548a3028d8c9 100644 (file)
@@ -1398,7 +1398,7 @@ class InventoryNode(object):
         return self.name == other.name and self.devices == other.devices
 
 
-class DeviceLightLoc(namedtuple('DeviceLightLoc', ['host', 'dev'])):
+class DeviceLightLoc(namedtuple('DeviceLightLoc', ['host', 'dev', 'path'])):
     """
     Describes a specific device on a specific host. Used for enabling or disabling LEDs
     on devices.