diff options
author | Sage Weil <sage@redhat.com> | 2019-12-15 17:36:51 +0100 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2019-12-20 14:07:04 +0100 |
commit | 4815cc8a73e45328e36b0968f7336b51d6432aeb (patch) | |
tree | 717d9510cbb0f73919cb7013ade910a4bf2706aa /src | |
parent | mgr: report device by-path paths too (diff) | |
download | ceph-4815cc8a73e45328e36b0968f7336b51d6432aeb.tar.xz ceph-4815cc8a73e45328e36b0968f7336b51d6432aeb.zip |
mgr/orchestrator: use full device path for blinking lights (if available)
Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/pybind/mgr/cephadm/module.py | 4 | ||||
-rw-r--r-- | src/pybind/mgr/cephadm/tests/test_cephadm.py | 2 | ||||
-rw-r--r-- | src/pybind/mgr/orchestrator.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 550c07c6247..78b7edb117b 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -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, diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index c93353d5bd8..6cda1902dc5 100644 --- a/src/pybind/mgr/cephadm/tests/test_cephadm.py +++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py @@ -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'] diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 27d3b8f3d35..4d4b672d0c6 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -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. |