From: Michael Fritch Date: Thu, 13 May 2021 23:03:32 +0000 (-0600) Subject: cephadm: clean-up error message X-Git-Tag: v17.1.0~1831^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=870e9bddd2a059ae4930a2eed163bb862094dcaa;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 --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index df1b04f64537..0d9c957ab1d4 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2267,8 +2267,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) @@ -2276,8 +2276,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