From: Sage Weil Date: Mon, 9 Aug 2021 18:15:28 +0000 (-0400) Subject: cephadm: fix container name detection X-Git-Tag: v16.2.6~54^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F42736%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 (cherry picked from commit fb5e4b3740241d5c41b348e0fc5f59ebde5ee558) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index fefc682d16bc..af720c6144b5 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2093,7 +2093,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