From 82efffdf62e3834f0e5f24846f2c839582906524 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 1 Apr 2016 16:52:48 -0700 Subject: [PATCH] inline _match_webroot_with_domains --- letsencrypt/plugins/webroot.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/letsencrypt/plugins/webroot.py b/letsencrypt/plugins/webroot.py index 5f3c04448..57bccb13c 100644 --- a/letsencrypt/plugins/webroot.py +++ b/letsencrypt/plugins/webroot.py @@ -201,7 +201,9 @@ class _WebrootPathAction(argparse.Action): if namespace.webroot_path: # Apply previous webroot to all matched # domains before setting the new webroot path - _match_webroot_with_domains(namespace) + prev_webroot = namespace.webroot_path[-1] + for domain in namespace.domains: + namespace.webroot_map.setdefault(domain, prev_webroot) elif namespace.domains: self._domain_before_webroot = True @@ -221,16 +223,3 @@ def _validate_webroot(webroot_path): raise errors.PluginError(webroot_path + " does not exist or is not a directory") return os.path.abspath(webroot_path) - - -def _match_webroot_with_domains(args_or_config): - """Applies the most recent webroot path to all unmatched domains. - - :param args_or_config: parsed command line arguments - :type args_or_config: argparse.Namespace or - configuration.NamespaceConfig - - """ - webroot_path = args_or_config.webroot_path[-1] - for domain in args_or_config.domains: - args_or_config.webroot_map.setdefault(domain, webroot_path)