]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: fix container name detection 42726/head
authorSage Weil <sage@newdream.net>
Mon, 9 Aug 2021 18:15:28 +0000 (14:15 -0400)
committerSage Weil <sage@newdream.net>
Mon, 9 Aug 2021 18:15:28 +0000 (14:15 -0400)
'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>
src/cephadm/cephadm

index 151ba372432e5413d1ded785bd5929a94d185111..9a185aa7a97863d39be941f9c52bac21af05fdaa 100755 (executable)
@@ -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