From: Daniel Pivonka Date: Thu, 18 Feb 2021 21:23:23 +0000 (-0500) Subject: cephadm: version command hide traceback when login is needed X-Git-Tag: v16.2.0~119^2~57 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c7c59ce9e66e1c832750870fdff98f7ce91b60b8;p=ceph.git cephadm: version command hide traceback when login is needed 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 (cherry picked from commit 4c1c656d009230894674d33efed9c31b2bc2581d) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 83eb53b6ad94..aaed128d530d 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -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 ##################################