def update(cls, repo_id, importer_id, schedule_id, updates): """ Update an existing sync schedule. :param repo_id: unique ID for a repository :type repo_id: basestring :param importer_id: unique ID for an importer :type importer_id: basestring :param schedule_id: unique ID for a schedule :type schedule_id: basestring :param updates: dictionary of updates to apply :type updates: dict :return ScheduledCall instance as it appears after the update :rtype pulp.server.db.model.dispatch.ScheduledCall """ cls.validate_importer(repo_id, importer_id) # legacy logic that can't be explained if 'override_config' in updates: updates['kwargs'] = {'overrides': updates.pop('override_config')} utils.validate_updated_schedule_options(updates) return utils.update(schedule_id, updates)
def update(cls, repo_id, distributor_id, schedule_id, updates): """ Update an existing scheduled publish for the given repository and distributor. :param repo_id: unique ID for a repository :type repo_id: basestring :param distributor_id: unique ID for a distributor :type distributor_id: basestring :param schedule_id: unique ID for a schedule :type schedule_id: basestring :param updates: dictionary of updates to apply :type updates: dict :return ScheduledCall instance as it appears after the update :rtype pulp.server.db.model.dispatch.ScheduledCall """ model.Distributor.objects.get_or_404(repo_id=repo_id, distributor_id=distributor_id) if "override_config" in updates: updates["kwargs"] = {"overrides": updates.pop("override_config")} utils.validate_updated_schedule_options(updates) return utils.update(schedule_id, updates)
def update(cls, repo_id, distributor_id, schedule_id, updates): """ Update an existing scheduled publish for the given repository and distributor. :param repo_id: unique ID for a repository :type repo_id: basestring :param distributor_id: unique ID for a distributor :type distributor_id: basestring :param schedule_id: unique ID for a schedule :type schedule_id: basestring :param updates: dictionary of updates to apply :type updates: dict :return ScheduledCall instance as it appears after the update :rtype pulp.server.db.model.dispatch.ScheduledCall """ cls.validate_distributor(repo_id, distributor_id) if 'override_config' in updates: updates['kwargs'] = {'overrides': updates.pop('override_config')} utils.validate_updated_schedule_options(updates) return utils.update(schedule_id, updates)