]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: clean-up error message 41351/head
authorMichael Fritch <mfritch@suse.com>
Thu, 13 May 2021 23:03:32 +0000 (17:03 -0600)
committerMichael Fritch <mfritch@suse.com>
Fri, 14 May 2021 22:31:41 +0000 (16:31 -0600)
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 <mfritch@suse.com>
src/cephadm/cephadm

index df1b04f64537990f608fdfc1f715c62cdf10509c..0d9c957ab1d475f186eaf4ee80b95ba492f0195f 100755 (executable)
@@ -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