diff --git a/certbot-apache/certbot_apache/override_centos.py b/certbot-apache/certbot_apache/override_centos.py index 2e5ef9a45..1995fd2a2 100644 --- a/certbot-apache/certbot_apache/override_centos.py +++ b/certbot-apache/certbot_apache/override_centos.py @@ -93,7 +93,8 @@ class CentOSConfigurator(configurator.ApacheConfigurator): if self.parser.not_modssl_ifmodule(noarg_path): # pylint: disable=no-member if self.parser.loc["default"] in noarg_path: # LoadModule already in the main configuration file - if "ifmodule/" in noarg_path or "ifmodule[1]" in noarg_path.lower(): + if ("ifmodule/" in noarg_path.lower() or + "ifmodule[1]" in noarg_path.lower()): # It's the first or only IfModule in the file return # Populate the list of known !mod_ssl.c IfModules diff --git a/certbot-apache/certbot_apache/parser.py b/certbot-apache/certbot_apache/parser.py index 085ede166..abd0cd879 100644 --- a/certbot-apache/certbot_apache/parser.py +++ b/certbot-apache/certbot_apache/parser.py @@ -300,6 +300,11 @@ class ApacheParser(object): :param bool beginning: If the IfModule should be created to the beginning of augeas path DOM tree. + :returns: Augeas path of the requested IfModule directive that pre-existed + or was created during the process. The path may be dynamic, + i.e. .../IfModule[last()] + :rtype: str + """ if_mods = self.aug.match(("%s/IfModule/*[self::arg='%s']" % (aug_conf_path, mod))) @@ -310,7 +315,7 @@ class ApacheParser(object): return if_mods[0].rpartition("arg")[0] def create_ifmod(self, aug_conf_path, mod, beginning=False): - """Creates a new and returs it path. + """Creates a new and returns its path. :param str aug_conf_path: Augeas configuration path :param str mod: module ie. mod_ssl.c