From: Michael Fritch Date: Thu, 13 May 2021 23:03:32 +0000 (-0600) Subject: cephadm: clean-up error message X-Git-Tag: v16.2.5~87^2~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9f310ec200629deaec8ff8f4e1b85974cd5b8095;p=ceph.git cephadm: clean-up error message use the standard error message from FileNotFound: ``` cephadm bootstrap --mon-ip 192.168.1.1 --config ~/foobar ERROR: [Errno 2] No such file or directory: '/root/foobar' ``` Signed-off-by: Michael Fritch (cherry picked from commit 870e9bddd2a059ae4930a2eed163bb862094dcaa) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 1b0fe9b069a..1c23a7ce637 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2259,8 +2259,8 @@ def get_config_and_keyring(ctx): try: with open(ctx.config, 'r') as f: config = f.read() - except FileNotFoundError: - raise Error('config file: %s does not exist' % ctx.config) + except FileNotFoundError as e: + raise Error(e) if 'key' in ctx and ctx.key: keyring = '[%s]\n\tkey = %s\n' % (ctx.name, ctx.key) @@ -2268,8 +2268,8 @@ def get_config_and_keyring(ctx): try: with open(ctx.keyring, 'r') as f: keyring = f.read() - except FileNotFoundError: - raise Error('keyring file: %s does not exist' % ctx.keyring) + except FileNotFoundError as e: + raise Error(e) return config, keyring