def _verify_no_certbot_redirect(self, vhost):
        rewrite_path = self.parser.find_dir(
            "RewriteRule", None, start=vhost.path)

        # There can be other RewriteRule directive lines in vhost config.
        # rewrite_args_dict keys are directive ids and the corresponding value
        # for each is a list of arguments to that directive.
        rewrite_args_dict = defaultdict(list)
        pat = r'.*(directive\[\d+\]).*'
        for match in rewrite_path:
            m = re.match(pat, match)
            if m:
                dir_id = m.group(1)
                rewrite_args_dict[dir_id].append(match)

        if rewrite_args_dict:
            redirect_args = [constants.REWRITE_HTTPS_ARGS,
                             constants.REWRITE_HTTPS_ARGS_WITH_END]

            for matches in rewrite_args_dict.values():
                if [self.aug.get(x) for x in matches] in redirect_args:
                    raise errors.PluginEnhancementAlreadyPresent(
                        "Certbot has already enabled redirection")
Executes a single command.
dataset/ETHPy150Open letsencrypt/letsencrypt/certbot-apache/certbot_apache/configurator.py/ApacheConfigurator._verify_no_certbot_redirect--crossover with--dataset/ETHPy150Open adblockplus/gyp/gyptest.py/CommandRunner.execute