]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-22324] osd add the environ variables for debug mode in ceph-volume 456/head
authorAlfredo Deza <adeza@redhat.com>
Wed, 6 Dec 2017 14:24:33 +0000 (09:24 -0500)
committerAlfredo Deza <adeza@redhat.com>
Wed, 6 Dec 2017 14:24:33 +0000 (09:24 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph_deploy/osd.py

index f62c1066cbb873ada32254e936301b0a7047685a..b2340e2a9ebea5369949c06409c916b1bb45dbc0 100644 (file)
@@ -185,7 +185,8 @@ def create_osd(
         dmcrypt_dir,
         storetype,
         block_wal,
-        block_db):
+        block_db,
+        **kw):
     """
     Run on osd node, creates an OSD from a data disk.
     """
@@ -218,10 +219,18 @@ def create_osd(
         args.append('--journal')
         args.append(journal)
 
-    remoto.process.run(
-        conn,
-        args
-    )
+    if kw.get('debug'):
+        remoto.process.run(
+            conn,
+            args,
+            env={'CEPH_VOLUME_DEBUG': '1'}
+        )
+
+    else:
+        remoto.process.run(
+            conn,
+            args
+        )
 
 
 def create(args, cfg, create=False):
@@ -285,6 +294,7 @@ def create(args, cfg, create=False):
             storetype=storetype,
             block_wal=args.block_wal,
             block_db=args.block_db,
+            debug=args.debug,
         )
 
         # give the OSD a few seconds to start
@@ -323,15 +333,27 @@ def disk_zap(args):
         distro.conn.remote_module.zeroing(disk)
 
         ceph_volume_executable = system.executable_path(distro.conn, 'ceph-volume')
-        remoto.process.run(
-            distro.conn,
-            [
-                ceph_volume_executable,
-                'lvm',
-                'zap',
-                disk,
-            ],
-        )
+        if args.debug:
+            remoto.process.run(
+                distro.conn,
+                [
+                    ceph_volume_executable,
+                    'lvm',
+                    'zap',
+                    disk,
+                ],
+                env={'CEPH_VOLUME_DEBUG': '1'}
+            )
+        else:
+            remoto.process.run(
+                distro.conn,
+                [
+                    ceph_volume_executable,
+                    'lvm',
+                    'zap',
+                    disk,
+                ],
+            )
 
         distro.conn.exit()
 
@@ -370,14 +392,26 @@ def osd_list(args, cfg):
 
         LOG.debug('Listing disks on {hostname}...'.format(hostname=hostname))
         ceph_volume_executable = system.executable_path(distro.conn, 'ceph-volume')
-        remoto.process.run(
-            distro.conn,
-            [
-                ceph_volume_executable,
-                'lvm',
-                'list',
-            ],
-        )
+        if args.debug:
+            remoto.process.run(
+                distro.conn,
+                [
+                    ceph_volume_executable,
+                    'lvm',
+                    'list',
+                ],
+                env={'CEPH_VOLUME_DEBUG': '1'}
+
+            )
+        else:
+            remoto.process.run(
+                distro.conn,
+                [
+                    ceph_volume_executable,
+                    'lvm',
+                    'list',
+                ],
+            )
         distro.conn.exit()