def set_all_hosts_roles(self, cluster_id):
        for host_str in CONF.host_roles.split(';'):
            host_str = host_str.strip()
            hostname, roles_str = host_str.split('=', 1)

            assert(hostname in self.host_mapping)
            host_id = self.host_mapping[hostname]

            roles = [role.strip() for role in roles_str.split(',') if role]

            self.set_host_roles(cluster_id, host_id, roles)
            self.host_roles[hostname] = roles

        unassigned_hostnames = list(set(self.host_mapping.keys())
                                    - set(self.host_roles.keys()))

        unassigned_roles = [role for role, status in self.role_mapping.items()
                            if is_role_unassigned(status)]

        assert(len(unassigned_roles) >= len(unassigned_hostnames))

        for hostname, role in map(
            None,
            unassigned_hostnames,
            unassigned_roles
        ):
            host_id = self.host_mapping[hostname]
            self.set_host_roles(cluster_id, host_id, [role])
            self.host_roles[hostname] = [role]

        unassigned_hostnames = list(set(self.host_mapping.keys())
                                    - set(self.host_roles.keys()))

        if not unassigned_hostnames:
            return

        # assign default roles to unassigned hosts
        default_roles = [
            role for role in CONF.default_roles.split(',')
            if role
        ]

        assert(default_roles)

        cycle_roles = itertools.cycle(default_roles)
        for hostname in unassigned_hostnames:
            host_id = self.host_mapping[hostname]
            roles = [cycle_roles.next()]
            self.set_host_roles(cluster_id, host_id, roles)
            self.host_roles[hostname] = roles
dataset/ETHPy150Open openstack/compass-core/bin/client.py/CompassClient.set_all_hosts_roles/swapped operands of `>=`