Address review comments

This commit is contained in:
Joona Hoikkala 2019-03-28 12:22:38 +02:00
parent bd727d3127
commit 794c1dc13f
No known key found for this signature in database
GPG key ID: D5AA86BBF9B29A5C
2 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -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 <IfMod mod> and returs it path.
"""Creates a new <IfMod mod> and returns its path.
:param str aug_conf_path: Augeas configuration path
:param str mod: module ie. mod_ssl.c