]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: fix container name detection 42736/head
authorSage Weil <sage@newdream.net>
Mon, 9 Aug 2021 18:15:28 +0000 (14:15 -0400)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 14:36:34 +0000 (16:36 +0200)
'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 <sage@newdream.net>
(cherry picked from commit fb5e4b3740241d5c41b348e0fc5f59ebde5ee558)

src/cephadm/cephadm

index fefc682d16bcfd49b197b0ba33f734c9d67f36e6..af720c6144b52de24adb94a36fa77fd2a5fdde83 100755 (executable)
@@ -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