Add webroot_map to default detection

This commit is contained in:
Brad Warren
2016-03-31 19:13:35 -07:00
parent 98493f72b6
commit 42c1638772
2 changed files with 5 additions and 6 deletions
+2 -1
View File
@@ -100,7 +100,8 @@ ZERO_ARG_ACTIONS = set(("store_const", "store_true",
# Maps a config option to a list of config options that may have modified it.
# This dictionary is used recursively, so if A modifies B and B modifies C,
# it is determined that C was modified by the user if A was modified.
VAR_MODIFIERS = {"account": ["server"], "server": ["dry_run", "staging"]}
VAR_MODIFIERS = {"account": ["server"], "server": ["dry_run", "staging"],
"webroot_map": ["webroot_path"]}
def usage_strings(plugins):
+3 -5
View File
@@ -96,16 +96,14 @@ def _restore_webroot_config(config, renewalparams):
form.
"""
if "webroot_map" in renewalparams:
# if the user does anything that would create a new webroot map on the
# CLI, don't use the old one
if not (cli.set_by_cli("webroot_map") or cli.set_by_cli("webroot_path")):
setattr(config.namespace, "webroot_map", renewalparams["webroot_map"])
if not cli.set_by_cli("webroot_map"):
config.namespace.webroot_map = renewalparams["webroot_map"]
elif "webroot_path" in renewalparams:
logger.info("Ancient renewal conf file without webroot-map, restoring webroot-path")
wp = renewalparams["webroot_path"]
if isinstance(wp, str): # prior to 0.1.0, webroot_path was a string
wp = [wp]
setattr(config.namespace, "webroot_path", wp)
config.namespace.webroot_path = wp
def _restore_plugin_configs(config, renewalparams):