mirror of
https://github.com/ceph/ceph
synced 2024-12-29 06:52:35 +00:00
Merge pull request #20594 from ceph/wip-rm23004
ceph-volume: log the current running command for easier debugging Reviewed-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
commit
9c8afc2365
@ -137,6 +137,7 @@ Ceph Conf: {ceph_path}
|
||||
conf.log_path = os.path.join(args.log_path, 'ceph-volume.log')
|
||||
log.setup()
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.info("Running command: ceph-volume %s %s", " ".join(main_args), " ".join(subcommand_args))
|
||||
# set all variables from args and load everything needed according to
|
||||
# them
|
||||
self.load_ceph_conf_path(cluster_name=args.cluster)
|
||||
|
@ -34,6 +34,15 @@ class TestVolume(object):
|
||||
main.Volume(argv=['ceph-volume', '--cluster', 'barnacle', 'lvm', '--help'])
|
||||
# make sure we aren't causing an actual error
|
||||
assert error.value.code == 0
|
||||
log = caplog.records[0]
|
||||
log = caplog.records[1]
|
||||
assert log.message == 'ignoring inability to load ceph.conf'
|
||||
assert log.levelname == 'ERROR'
|
||||
|
||||
def test_logs_current_command(self, caplog):
|
||||
with pytest.raises(SystemExit) as error:
|
||||
main.Volume(argv=['ceph-volume', '--cluster', 'barnacle', 'lvm', '--help'])
|
||||
# make sure we aren't causing an actual error
|
||||
assert error.value.code == 0
|
||||
log = caplog.records[0]
|
||||
assert log.message == 'Running command: ceph-volume --cluster barnacle lvm --help'
|
||||
assert log.levelname == 'INFO'
|
||||
|
Loading…
Reference in New Issue
Block a user