This commit is contained in:
Peter Eckersley
2015-11-21 10:59:15 -08:00
parent f2f9d33e03
commit f48ef6ded9
2 changed files with 6 additions and 7 deletions
+4 -3
View File
@@ -1038,7 +1038,7 @@ def _plugins_parsing(helpful, plugins):
helpful.add_plugin_args(plugins)
class WebrootPathProcessor(argparse.Action):
class WebrootPathProcessor(argparse.Action): # pylint: disable=missing-docstring
def __call__(self, parser, config, webroot, option_string=None):
"""
Keep a record of --webroot-path / -w flags during processing, so that
@@ -1056,13 +1056,14 @@ class WebrootPathProcessor(argparse.Action):
config.webroot_path.append(webroot)
class DomainFlagProcessor(argparse.Action):
class DomainFlagProcessor(argparse.Action): # pylint: disable=missing-docstring
def __call__(self, parser, config, domain_arg, option_string=None):
"""
Process a new -d flag, helping the webroot plugin construct a map of
{domain : webrootpath} if -w / --webroot-path is in use
"""
if not config.domains: config.domains = []
if not config.domains:
config.domains = []
new_domains = [d.strip() for d in domain_arg.split(",")
if d not in config.domains]
config.domains.extend(new_domains)
+2 -4
View File
@@ -38,7 +38,6 @@ Use the following snippet in your ``server{...}`` stanza::
and reload your daemon.
"""
import argparse
import errno
import logging
import os
@@ -92,8 +91,7 @@ to serve all files under specified web root ({0})."""
self.option_name("path")))
for name, path in path_map.items():
if not os.path.isdir(path):
raise errors.PluginError(
path + " does not exist or is not a directory")
raise errors.PluginError(path + " does not exist or is not a directory")
self.full_roots[name] = os.path.join(path, challenges.HTTP01.URI_ROOT_PATH)
logger.debug("Creating root challenges validation dir at %s",
@@ -107,7 +105,7 @@ to serve all files under specified web root ({0})."""
"challenge responses: {1}", name, exception)
def perform(self, achalls): # pylint: disable=missing-docstring
assert self.full_root, "Webroot plugin appears to be missing webroot map"
assert self.full_roots, "Webroot plugin appears to be missing webroot map"
return [self._perform_single(achall) for achall in achalls]
def _path_for_achall(self, achall):