]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: merge `--config-and-keyring` and `--config-json` args
authorMichael Fritch <mfritch@suse.com>
Wed, 11 Mar 2020 01:27:36 +0000 (19:27 -0600)
committerMichael Fritch <mfritch@suse.com>
Wed, 11 Mar 2020 20:02:12 +0000 (14:02 -0600)
both are passed via stdin from the mgr in a JSON format

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm
src/pybind/mgr/cephadm/module.py

index a1ff329d9a679464c74528a124c8aff5f22811a0..396f7b3dffebf04b293370abf5c8b9712ca673cf 100755 (executable)
@@ -31,7 +31,7 @@ You can invoke cephadm in two ways:
 
        injected_argv = ['ls']
 
-   For reading stdin from the '--config-and-json -' argument,
+   For reading stdin from the '--config-json -' argument,
 
        injected_stdin = '...'
 """
@@ -1124,14 +1124,14 @@ def get_parm(option):
 
 def get_config_and_keyring():
     # type: () -> Tuple[str, str]
-    if args.config_and_keyring:
-        if args.config_and_keyring == '-':
+    if 'config_json' in args and args.config_json:
+        if args.config_json == '-':
             try:
                 j = injected_stdin # type: ignore
             except NameError:
                 j = sys.stdin.read()
         else:
-            with open(args.config_and_keyring, 'r') as f:
+            with open(args.config_json, 'r') as f:
                 j = f.read()
         d = json.loads(j)
         config = d.get('config')
@@ -2296,8 +2296,8 @@ def command_ceph_volume():
     tmp_config = None
     tmp_keyring = None
 
-    if args.config_and_keyring:
-        # note: this will always pull from args.config_and_keyring (we
+    if args.config_json:
+        # note: this will always pull from args.config_json (we
         # require it) and never args.config or args.keyring.
         (config, keyring) = get_config_and_keyring()
 
@@ -3481,7 +3481,7 @@ def _get_parser():
         '--fsid',
         help='cluster FSID')
     parser_ceph_volume.add_argument(
-        '--config-and-keyring',
+        '--config-json',
         help='JSON file with config and (client.bootrap-osd) key')
     parser_ceph_volume.add_argument(
         'command', nargs='+',
@@ -3630,9 +3630,6 @@ def _get_parser():
     parser_deploy.add_argument(
         '--key',
         help='key for new daemon')
-    parser_deploy.add_argument(
-        '--config-and-keyring',
-        help='JSON file with config and keyrings for the daemon and crash agent')
     parser_deploy.add_argument(
         '--osd-fsid',
         help='OSD uuid, if creating an OSD container')
index f2d43765249ad7f1de9aceb011eb71cbba84c96c..1ad560ea38ff0b5fd532f1d846f98c3323fd5116 100644 (file)
@@ -1987,7 +1987,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
         before_osd_uuid_map = self.get_osd_uuid_map(only_up=True)
 
         split_cmd = cmd.split(' ')
-        _cmd = ['--config-and-keyring', '-', '--']
+        _cmd = ['--config-json', '-', '--']
         _cmd.extend(split_cmd)
         out, err, code = self._run_cephadm(
             host, 'osd', 'ceph-volume',
@@ -2102,7 +2102,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
                 'config': config,
                 'keyring': keyring,
             }
-            extra_args.extend(['--config-and-keyring', '-'])
+            extra_args.extend(['--config-json', '-'])
 
             # osd deployments needs an --osd-uuid arg
             if daemon_type == 'osd':