From: John Mulligan Date: Thu, 19 Oct 2023 20:25:17 +0000 (-0400) Subject: cephadm: make get_daemon_args private X-Git-Tag: v19.0.0~150^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3bb4545d6b304bd2ee622c3778fc94280a519a0e;p=ceph.git cephadm: make get_daemon_args private The get_daemon_args function now only has one caller. To double check that and to prepare for this function's eventual removal we prefix the name with an underscore to take it private. Signed-off-by: John Mulligan --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index f8b0243e37bc..9a36360bf2dc 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -2318,7 +2318,7 @@ def get_legacy_daemon_fsid(ctx, cluster, return fsid -def get_daemon_args(ctx: CephadmContext, ident: 'DaemonIdentity') -> List[str]: +def _get_daemon_args(ctx: CephadmContext, ident: 'DaemonIdentity') -> List[str]: r = list() # type: List[str] daemon_type = ident.daemon_type @@ -2847,7 +2847,7 @@ def get_container( ctx, ident=ident, entrypoint=entrypoint, - args=ceph_args + get_daemon_args(ctx, ident), + args=ceph_args + _get_daemon_args(ctx, ident), container_args=container_args, volume_mounts=get_container_mounts(ctx, ident), bind_mounts=get_container_binds(ctx, ident), diff --git a/src/cephadm/tests/test_cephadm.py b/src/cephadm/tests/test_cephadm.py index f933e3bc4708..c12bb9ec5c91 100644 --- a/src/cephadm/tests/test_cephadm.py +++ b/src/cephadm/tests/test_cephadm.py @@ -1229,9 +1229,9 @@ class TestMonitoring(object): daemon_type = 'prometheus' daemon_id = 'home' fsid = 'aaf5a720-13fe-4a3b-82b9-2d99b7fd9704' - args = _cephadm.get_daemon_args( + args = _cephadm.Monitoring.create( ctx, _cephadm.DaemonIdentity(fsid, daemon_type, daemon_id) - ) + ).get_daemon_args() assert any([x.startswith('--web.external-url=http://') for x in args]) @mock.patch('cephadm.call')