From: Alfredo Deza Date: Wed, 6 Dec 2017 14:24:33 +0000 (-0500) Subject: [RM-22324] osd add the environ variables for debug mode in ceph-volume X-Git-Tag: v2.0.0~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c45a18ac10e95f33f50e66a5a69fd152421dcf19;p=ceph-deploy.git [RM-22324] osd add the environ variables for debug mode in ceph-volume Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/osd.py b/ceph_deploy/osd.py index f62c106..b2340e2 100644 --- a/ceph_deploy/osd.py +++ b/ceph_deploy/osd.py @@ -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()