]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume util.prepare allow extra ad-hoc mount flags
authorAlfredo Deza <adeza@redhat.com>
Fri, 13 Apr 2018 19:52:55 +0000 (15:52 -0400)
committerAlfredo Deza <adeza@redhat.com>
Mon, 16 Apr 2018 16:50:33 +0000 (12:50 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/util/prepare.py

index 3b5eb7fa719e2c88c48013208cc2f994dc2067ed..e57dc145d8ef71dbe0571f082cb5ff1c680ad23d 100644 (file)
@@ -144,7 +144,7 @@ def format_device(device):
     process.run(command)
 
 
-def _normalize_mount_flags(flags):
+def _normalize_mount_flags(flags, extras=None):
     """
     Mount flag options have to be a single string, separated by a comma. If the
     flags are separated by spaces, or with commas and spaces in ceph.conf, the
@@ -159,20 +159,27 @@ def _normalize_mount_flags(flags):
         [" rw ,", "exec"]
 
     :param flags: A list of flags, or a single string of mount flags
+    :param extras: Extra set of mount flags, useful when custom devices like VDO need
+                   ad-hoc mount configurations
     """
     if isinstance(flags, list):
+        if extras:
+            flags.extend(extras)
         # ensure that spaces and commas are removed so that they can join
         # correctly
         return ','.join([f.strip().strip(',') for f in flags if f])
 
     # split them, clean them, and join them back again
     flags = flags.strip().split(' ')
+    if extras:
+        flags.extend(extras)
     return ','.join(
         [f.strip().strip(',') for f in flags if f]
     )
 
 
-def mount_osd(device, osd_id):
+def mount_osd(device, osd_id, **kw):
+    is_vdo = kw.get('is_vdo', 0)
     destination = '/var/lib/ceph/osd/%s-%s' % (conf.cluster, osd_id)
     command = ['mount', '-t', 'xfs', '-o']
     flags = conf.ceph.get_list(