]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: version command hide traceback when login is needed
authorDaniel Pivonka <dpivonka@redhat.com>
Thu, 18 Feb 2021 21:23:23 +0000 (16:23 -0500)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 9 Mar 2021 09:18:50 +0000 (10:18 +0100)
if image comes from a authenticated registry and login has not been done yet the traceback should be hidden and only show the error message

Signed-off-by: Daniel Pivonka <dpivonka@redhat.com>
(cherry picked from commit 4c1c656d009230894674d33efed9c31b2bc2581d)

src/cephadm/cephadm

index 83eb53b6ad94b9f8dced82e546e9f32d5bee3522..aaed128d530dd0dbd77d9b93e533c7411f32cef8 100755 (executable)
@@ -3086,9 +3086,11 @@ class CephContainer:
 @infer_image
 def command_version(ctx):
     # type: (CephadmContext) -> int
-    out = CephContainer(ctx, ctx.image, 'ceph', ['--version']).run()
-    print(out.strip())
-    return 0
+    c = CephContainer(ctx, ctx.image, 'ceph', ['--version'])
+    out, err, ret = call(ctx, c.run_cmd(), desc=c.entrypoint)
+    if not ret:
+        print(out.strip())
+    return ret
 
 ##################################