From: Sage Weil Date: Mon, 15 Mar 2021 22:34:57 +0000 (-0500) Subject: mgr/cephadm: fix 'auth caps' fallback X-Git-Tag: v17.1.0~2607^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=19c75234433c4ce5073a13dbada88f437c2dd0ad;p=ceph-ci.git mgr/cephadm: fix 'auth caps' fallback The first get-or-create attempt also needs to tolerate failure. Fixes: 8ceea1961f818dc2d07edf9c256ebe5150b6b133 Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/services/cephadmservice.py b/src/pybind/mgr/cephadm/services/cephadmservice.py index 31a791ee884..53f89027603 100644 --- a/src/pybind/mgr/cephadm/services/cephadmservice.py +++ b/src/pybind/mgr/cephadm/services/cephadmservice.py @@ -144,7 +144,7 @@ class CephadmService(metaclass=ABCMeta): return DaemonDescription() def get_keyring_with_caps(self, entity: AuthEntity, caps: List[str]) -> str: - ret, keyring, err = self.mgr.check_mon_command({ + ret, keyring, err = self.mgr.mon_command({ 'prefix': 'auth get-or-create', 'entity': entity, 'caps': caps, diff --git a/src/pybind/mgr/cephadm/tests/test_services.py b/src/pybind/mgr/cephadm/tests/test_services.py index 2c2bdfb3584..e52a2672996 100644 --- a/src/pybind/mgr/cephadm/tests/test_services.py +++ b/src/pybind/mgr/cephadm/tests/test_services.py @@ -115,7 +115,7 @@ class TestCephadmService: 'entity': 'client.iscsi.a', 'caps': expected_caps}) - assert expected_call in mgr.check_mon_command.mock_calls + assert expected_call in mgr.mon_command.mock_calls assert expected_call2 in mgr.mon_command.mock_calls def test_get_auth_entity(self):