if used_devices:
for device in used_devices:
args.filtered_devices[device] = {"reasons": ["Used by ceph as a data device already"]}
- if not args.report:
- mlogger.info("Ignoring devices already used by ceph: %s" % ",".join(used_devices))
- if not unused_devices and not args.report:
+ if args.yes and unused_devices:
+ mlogger.info("Ignoring devices already used by ceph: %s" % ", ".join(used_devices))
+ if not unused_devices and not args.format == 'json':
# report nothing changed
mlogger.info("All devices are already used by ceph. No OSDs will be created.")
raise SystemExit(0)
else:
new_strategy = get_strategy(args, unused_devices)
- if strategy != new_strategy:
+ if new_strategy and strategy != new_strategy:
if args.report:
mlogger.info("Ignoring devices already used by ceph: %s" % ",".join(used_devices))
- mlogger.error("aborting because strategy changed from %s to %s after filtering" % (strategy.type(), new_strategy.type()))
+ mlogger.error("Aborting because strategy changed from %s to %s after filtering" % (strategy.type(), new_strategy.type()))
raise SystemExit(1)
return strategy(unused_devices, args)
def report_pretty(self):
string = ""
+ if self.args.filtered_devices:
+ string += templates.filtered_devices(self.args.filtered_devices)
string += templates.total_osds.format(
total_osds=self.total_osds,
)
db_size = str(disk.Size(b=(vg_extents['sizes'])))
string = ""
+ if self.args.filtered_devices:
+ string += templates.filtered_devices(self.args.filtered_devices)
string += templates.total_osds.format(
total_osds=len(self.hdds) * self.osds_per_device
)
def report_pretty(self):
string = ""
+ if self.args.filtered_devices:
+ string += templates.filtered_devices(self.args.filtered_devices)
string += templates.total_osds.format(
total_osds=self.total_osds
)
def report_pretty(self):
string = ""
+ if self.args.filtered_devices:
+ string += templates.filtered_devices(self.args.filtered_devices)
string += templates.total_osds.format(
total_osds=self.total_osds
)
Total OSDs: {total_osds}
"""
+
+def filtered_devices(devices):
+ string = """
+Filtered Devices:"""
+ for device, info in devices.iteritems():
+ string += """
+ %s""" % device
+
+ for reason in info['reasons']:
+ string += """
+ %s""" % reason
+
+ string += "\n"
+ return string
+
+
ssd_volume_group = """
Solid State VG:
Targets: {target: <25} Total size: {total_lv_size: <25}