def exceeds_max_osds(args, reasonable=20): """ A very simple function to check against multiple OSDs getting created and warn about the possibility of more than the recommended which would cause issues with max allowed PIDs in a system. The check is done against the ``args.disk`` object that should look like:: [ ('cephnode-01', '/dev/sdb', '/dev/sda5'), ('cephnode-01', '/dev/sdc', '/dev/sda6'), ... ] """ hosts = [item[0] for item in args.disk] per_host_count = dict(((h, hosts.count(h)) for h in set(hosts) if hosts.count(h) > reasonable)) return per_host_count
def exceeds_max_osds(args, reasonable=20): """ A very simple function to check against multiple OSDs getting created and warn about the possibility of more than the recommended which would cause issues with max allowed PIDs in a system. The check is done against the ``args.disk`` object that should look like:: [ ('cephnode-01', '/dev/sdb', '/dev/sda5'), ('cephnode-01', '/dev/sdc', '/dev/sda6'), ... ] """ hosts = [item[0] for item in args.disk] per_host_count = dict(((h, hosts.count(h)) for h in set(hosts) if hosts.count(h) > reasonable)) return per_host_count