)
parser.add_argument(
'--block-db-size',
- type=int,
+ type=disk.Size.parse,
help='Set (or override) the "bluestore_block_db_size" value, in bytes'
)
parser.add_argument(
)
parser.add_argument(
'--block-wal-size',
- type=int,
+ type=disk.Size.parse,
help='Set (or override) the "bluestore_block_wal_size" value, in bytes'
)
parser.add_argument(
)
parser.add_argument(
'--journal-size',
- type=int,
+ type=disk.Size.parse,
help='Override the "osd_journal_size" value, in megabytes'
)
parser.add_argument(
return report
def report_json(self):
- return self._get_osd_plan()
+ # cast all values to string so that the report can be dumped in to
+ # json.dumps
+ return {k: str(v) for k, v in self._get_osd_plan().items()}
batch.ensure_disjoint_device_lists(devices, db_devices)
assert 'Device lists are not disjoint' in str(disjoint_ex.value)
+ @pytest.mark.parametrize('format_', ['pretty', 'json', 'json-pretty'])
+ def test_json_report(self, format_, factory, conf_ceph_stub, mock_device_generator):
+ # just ensure reporting works
+ conf_ceph_stub('[global]\nfsid=asdf-lkjh')
+ devs = [mock_device_generator() for _ in range(5)]
+ args = factory(data_slots=1,
+ osds_per_device=1,
+ osd_ids=[],
+ report=True,
+ format=format_,
+ devices=devs,
+ db_devices=[],
+ wal_devices=[],
+ bluestore=True,
+ block_db_size="1G",
+ )
+ b = batch.Batch([])
+ plan = b.get_plan(args)
+ b.args = args
+ b.report(plan)
+
def test_get_physical_osds_return_len(self, factory,
mock_devices_available,
osds_per_device):