diff --git a/letsencrypt/client/apache/parser.py b/letsencrypt/client/apache/parser.py index a9c50269f..efc692d97 100644 --- a/letsencrypt/client/apache/parser.py +++ b/letsencrypt/client/apache/parser.py @@ -255,11 +255,32 @@ class ApacheParser(object): "/augeas/load/Httpd/incl [. ='%s']" % filepath) if not inc_test: # Load up files - # self.aug.add_transform("Httpd.lns", - # self.httpd_incl, None, self.httpd_excl) + # This doesn't seem to work on TravisCI + # self.aug.add_transform("Httpd.lns", [filepath]) self._add_httpd_transform(filepath) self.aug.load() + def _add_httpd_transform(self, incl): + """Add a transform to Augeas. + + This function will correctly add a transform to augeas + The existing augeas.add_transform in python doesn't seem to work for + Travis CI as it loads in libaugeas.so.0.10.0 + + :param str incl: filepath to include for transform + + """ + last_include = self.aug.match("/augeas/load/Httpd/incl [last()]") + if last_include: + # Insert a new node immediately after the last incl + self.aug.insert(last_include[0], "incl", False) + self.aug.set("/augeas/load/Httpd/incl[last()]", incl) + # On first use... must load lens and add file to incl + else: + # Augeas uses base 1 indexing... insert at beginning... + self.aug.set("/augeas/load/Httpd/lens", "Httpd.lns") + self.aug.set("/augeas/load/Httpd/incl", incl) + def standardize_excl(self): """Standardize the excl arguments for the Httpd lens in Augeas. @@ -292,19 +313,6 @@ class ApacheParser(object): self.aug.load() - def _add_httpd_transform(self, incl): - """Add a transform to Augeas. - - This function will correctly add a transform to augeas - The existing augeas.add_transform in python is broken. - - :param str incl: TODO - - """ - last_include = self.aug.match("/augeas/load/Httpd/incl [last()]") - self.aug.insert(last_include[0], "incl", False) - self.aug.set("/augeas/load/Httpd/incl[last()]", incl) - def _set_locations(self, ssl_options): """Set default location for directives. diff --git a/letsencrypt/client/interfaces.py b/letsencrypt/client/interfaces.py index b052d6ac7..9e35a754a 100644 --- a/letsencrypt/client/interfaces.py +++ b/letsencrypt/client/interfaces.py @@ -17,13 +17,16 @@ class IAuthenticator(zope.interface.Interface): :param str domain: Domain for which challenge preferences are sought. :returns: list of strings with the most preferred challenges first. + If a type is not specified, it means the Authenticator cannot + perform the challenge. :rtype: list """ def perform(chall_list): """Perform the given challenge. - :param list chall_list: List of challenge types defined in client.py + :param list chall_list: List of namedtuple types defined in + challenge_util.py. DvsniChall...ect.. :returns: List of responses If the challenge cant be completed...