From: Sage Weil Date: Mon, 9 Aug 2021 18:15:28 +0000 (-0400) Subject: cephadm: fix container name detection X-Git-Tag: v17.1.0~1157^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F42726%2Fhead;p=ceph.git cephadm: fix container name detection 'enter' was broken because we weren't correctly identifying the container name. Strip the newline from the inspect result so that we can reliably match against the 'running' state. Signed-off-by: Sage Weil --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 151ba372432..9a185aa7a97 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2094,7 +2094,7 @@ def get_running_container_name(ctx: CephadmContext, c: 'CephContainer') -> Optio ctx.container_engine.path, 'container', 'inspect', '--format', '{{.State.Status}}', name ]) - if out == 'running': + if out.strip() == 'running': return name return None