Move --webroot-path processing into cli.py

Since it is now interdependent with --domains

(This is much more elegant than trying to APIify the interaction)
This commit is contained in:
Peter Eckersley
2015-11-21 10:59:15 -08:00
parent 19f348b416
commit e1f0fcca8f
2 changed files with 28 additions and 17 deletions
+2 -17
View File
@@ -54,22 +54,7 @@ from letsencrypt.plugins import common
logger = logging.getLogger(__name__)
class WebrootPathProcessor(argparse.Action):
def __call__(self, parser, config, webroot, option_string=None):
"""
Keep a record of --webroot-path / -w flags during processing, so that
we know which apply to which -d flags
"""
if not config.webroot_path:
config.webroot_path = []
# if any --domain flags preceded the first --webroot-path flag,
# apply that webroot path to those; subsequent entries in
# config.webroot_map are filled in by cli.DomainFlagProcessor
if config.domains:
config.webroot_map = dict([(d, webroot) for d in config.domains])
else:
config.webroot_map = {}
config.webroot_path.append(webroot)
class Authenticator(common.Plugin):
"""Webroot Authenticator."""
@@ -89,7 +74,7 @@ to serve all files under specified web root ({0})."""
@classmethod
def add_parser_arguments(cls, add):
add("path", "-w", help="public_html / webroot path", action=WebrootPathAccumulator)
pass
def get_chall_pref(self, domain): # pragma: no cover
# pylint: disable=missing-docstring,no-self-use,unused-argument