From 08a846636552b8aed23158329ee3ab0057787003 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 9 Aug 2021 14:15:28 -0400 Subject: [PATCH] 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) --- src/cephadm/cephadm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3