def iterate_configuration()

in src/es_pii_tool/base.py [0:0]


    def iterate_configuration(self) -> None:
        """Iterate over every configuration block in self.redactions"""
        logger.debug('Full redactions object from config: %s', self.redactions)
        for config_block in self.redactions['redactions']:  # type: ignore
            job_success = True
            # Reset counter to zero for each full iteration
            self.counter = 0
            if self.dry_run:
                logger.info("DRY-RUN MODE ENABLED. No data will be changed.")

            # There's really only 1 root-level key for each configuration block,
            # and that's job_id
            job_name = list(config_block.keys())[0]
            args = (self.client, self.tracking_index, job_name, config_block[job_name])
            job = Job(*args, dry_run=self.dry_run)
            if job.finished():
                continue
            job.begin()
            if not self.verify_doc_count(job):
                # This configuration block can't go further because of the mismatch
                job_success = False
                end_it(job, job_success)
                continue

            job_success = self.iterate_indices(job)
            # At this point, self.counter should be equal to total, indicating that we
            # matched expected_docs. We should therefore register that the job was
            # successful, if we have reached this point with no other errors having
            # interrupted the process.

            end_it(job, job_success)