# we warn only here, because it is possible that the configuration
# file is not needed, or that it will be loaded by some other means
# (like reading from lvm tags)
- logger.exception('ignoring inability to load ceph.conf')
- terminal.red(error)
+ logger.warning('ignoring inability to load ceph.conf', exc_info=1)
+ terminal.yellow(error)
# dispatch to sub-commands
terminal.dispatch(self.mapper, subcommand_args)
assert error.value.code == 0
log = caplog.records[-1]
assert log.message == 'ignoring inability to load ceph.conf'
- assert log.levelname == 'ERROR'
+ assert log.levelname == 'WARNING'
def test_logs_current_command(self, caplog):
with pytest.raises(SystemExit) as error:
assert log.message == 'Running command: ceph-volume --cluster barnacle lvm --help'
assert log.levelname == 'INFO'
- def test_logs_set_level_error(self, caplog):
+ def test_logs_set_level_warning(self, caplog):
with pytest.raises(SystemExit) as error:
- main.Volume(argv=['ceph-volume', '--log-level', 'error', '--cluster', 'barnacle', 'lvm', '--help'])
+ main.Volume(argv=['ceph-volume', '--log-level', 'warning', '--cluster', 'barnacle', 'lvm', '--help'])
# make sure we aren't causing an actual error
assert error.value.code == 0
assert caplog.records
- # only log levels of 'ERROR' or above should be captured
+ # only log levels of 'WARNING'
for log in caplog.records:
- assert log.levelname in ['ERROR', 'CRITICAL']
+ assert log.levelname == 'WARNING'
def test_logs_incorrect_log_level(self, capsys):
with pytest.raises(SystemExit) as error: