def unbind(group_id, repo_id, distributor_id, options): """ Unbind the members of the specified consumer group. :param group_id: A consumer group ID. :type group_id: str :param repo_id: A repository ID. :type repo_id: str :param distributor_id: A distributor ID. :type distributor_id: str :param options: Bind options passed to the agent handler. :type options: dict :return: TaskResult containing the ids of all the spawned tasks & bind errors :rtype: TaskResult """ manager = manager_factory.consumer_group_query_manager() group = manager.get_group(group_id) bind_errors = [] additional_tasks = [] for consumer_id in group['consumer_ids']: try: report = unbind_task(consumer_id, repo_id, distributor_id, options) if report: additional_tasks.extend(report.spawned_tasks) except PulpException, e: #Log a message so that we can debug but don't throw logger.warn(e.message) bind_errors.append(e) except Exception, e: bind_errors.append(e)
def unbind(group_id, repo_id, distributor_id, options): """ Unbind the members of the specified consumer group. :param group_id: A consumer group ID. :type group_id: str :param repo_id: A repository ID. :type repo_id: str :param distributor_id: A distributor ID. :type distributor_id: str :param options: Bind options passed to the agent handler. :type options: dict :return: TaskResult containing the ids of all the spawned tasks & bind errors :rtype: TaskResult """ manager = managers.consumer_group_query_manager() group = manager.get_group(group_id) bind_errors = [] additional_tasks = [] for consumer_id in group['consumer_ids']: try: report = unbind_task(consumer_id, repo_id, distributor_id, options) if report: additional_tasks.extend(report.spawned_tasks) except PulpException, e: #Log a message so that we can debug but don't throw logger.warn(e.message) bind_errors.append(e) except Exception, e: logger.exception(e) bind_errors.append(e)