]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume simple.activate allow to pass a file to activate
authorAlfredo Deza <adeza@redhat.com>
Wed, 8 Nov 2017 19:28:12 +0000 (14:28 -0500)
committerAlfredo Deza <adeza@redhat.com>
Thu, 9 Nov 2017 17:02:15 +0000 (12:02 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/devices/simple/activate.py

index 35cfbf14485d02333ade4afafdb723e23f92fe29..1a15718e2ee9c21a740ef53c8308da0ca27bcf3e 100644 (file)
@@ -104,7 +104,6 @@ class Activate(object):
             formatter_class=argparse.RawDescriptionHelpFormatter,
             description=sub_command_help,
         )
-
         parser.add_argument(
             'osd_id',
             metavar='ID',
@@ -117,6 +116,10 @@ class Activate(object):
             nargs='?',
             help='The FSID of the OSD, similar to a SHA1'
         )
+        parser.add_argument(
+            '--file',
+            help='The path to a JSON file, from a scanned OSD'
+        )
         if len(self.argv) == 0:
             print(sub_command_help)
             return
@@ -130,7 +133,10 @@ class Activate(object):
         # at a non-default location which would not work at boot time if the
         # custom location is not exposed through an ENV var
         json_dir = os.environ.get('CEPH_VOLUME_SIMPLE_JSON_DIR', '/etc/ceph/osd/')
-        json_config = os.path.join(json_dir, '%s-%s.json' % (args.osd_id, args.osd_fsid))
+        if args.file:
+            json_config = args.file
+        else:
+            json_config = os.path.join(json_dir, '%s-%s.json' % (args.osd_id, args.osd_fsid))
         if not os.path.exists(json_config):
             raise RuntimeError('Expected JSON config path not found: %s' % json_config)
         args.json_config = json_config