]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: allow config and keyring args for ceph-volume
authorMichael Fritch <mfritch@suse.com>
Wed, 11 Mar 2020 00:38:29 +0000 (18:38 -0600)
committerSage Weil <sage@redhat.com>
Wed, 25 Mar 2020 14:48:11 +0000 (09:48 -0500)
easier to script via the cephadm tests

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit bac530f06a60d96259376cd19224bdbffce1bdc4)

src/cephadm/cephadm

index 64515caa1d871c9296ae9fb85268e9166fa272c4..c89ce1dea928f998fd59abec26b98a5371c387c9 100755 (executable)
@@ -2637,19 +2637,16 @@ def command_ceph_volume():
     tmp_config = None
     tmp_keyring = None
 
-    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()
+    (config, keyring) = get_config_and_keyring()
 
-        # tmp keyring file
-        tmp_keyring = write_tmp(keyring, uid, gid)
+    # tmp keyring file
+    tmp_keyring = write_tmp(keyring, uid, gid)
 
-        # tmp config file
-        tmp_config = write_tmp(config, uid, gid)
+    # tmp config file
+    tmp_config = write_tmp(config, uid, gid)
 
-        mounts[tmp_config.name] = '/etc/ceph/ceph.conf:z'
-        mounts[tmp_keyring.name] = '/var/lib/ceph/bootstrap-osd/ceph.keyring:z'
+    mounts[tmp_config.name] = '/etc/ceph/ceph.conf:z'
+    mounts[tmp_keyring.name] = '/var/lib/ceph/bootstrap-osd/ceph.keyring:z'
 
     c = CephContainer(
         image=args.image,
@@ -3972,6 +3969,12 @@ def _get_parser():
     parser_ceph_volume.add_argument(
         '--config-json',
         help='JSON file with config and (client.bootrap-osd) key')
+    parser_ceph_volume.add_argument(
+        '--config', '-c',
+        help='ceph conf file')
+    parser_ceph_volume.add_argument(
+        '--keyring', '-k',
+        help='ceph.keyring to pass through to the container')
     parser_ceph_volume.add_argument(
         'command', nargs='+',
         help='command')