mirror of
https://github.com/certbot/certbot.git
synced 2026-07-30 18:04:31 +02:00
Fix the things I broke
This commit is contained in:
+10
-12
@@ -734,13 +734,13 @@ def _restore_required_config_elements(full_path, config, renewalparams):
|
|||||||
# so we don't know if the original was NoneType or str!
|
# so we don't know if the original was NoneType or str!
|
||||||
if value == "None":
|
if value == "None":
|
||||||
value = None
|
value = None
|
||||||
config.namespace__setattr__(config_item, value)
|
setattr(config.namespace, config_item, value)
|
||||||
# int-valued items to add if they're present
|
# int-valued items to add if they're present
|
||||||
for config_item in INT_CONFIG_ITEMS:
|
for config_item in INT_CONFIG_ITEMS:
|
||||||
if config_item in renewalparams:
|
if config_item in renewalparams:
|
||||||
try:
|
try:
|
||||||
value = int(renewalparams[config_item])
|
value = int(renewalparams[config_item])
|
||||||
config.namespace__setattr__(config_item, value)
|
setattr(config.namespace, config_item, value)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
logger.warning("Renewal configuration file %s specifies "
|
logger.warning("Renewal configuration file %s specifies "
|
||||||
"a non-numeric value for %s. Skipping.",
|
"a non-numeric value for %s. Skipping.",
|
||||||
@@ -766,18 +766,17 @@ def _restore_plugin_configs(config, renewalparams):
|
|||||||
# trying to read the file called "None")
|
# trying to read the file called "None")
|
||||||
# Should we omit the item entirely rather than setting
|
# Should we omit the item entirely rather than setting
|
||||||
# its value to None?
|
# its value to None?
|
||||||
config.namespace__setattr__(config_item, None)
|
setattr(config.namespace, config_item, None)
|
||||||
continue
|
continue
|
||||||
if config_item.startswith(plugin_prefix + "_"):
|
if config_item.startswith(plugin_prefix + "_"):
|
||||||
for action in _parser.parser._actions: # pylint: disable=protected-access
|
for action in _parser.parser._actions: # pylint: disable=protected-access
|
||||||
if action.type is not None and action.dest == config_item:
|
if action.type is not None and action.dest == config_item:
|
||||||
config.namespace__setattr__(
|
setattr(config.namespace, config_item,
|
||||||
config_item,
|
action.type(renewalparams[config_item]))
|
||||||
action.type(renewalparams[config_item]))
|
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
config.namespace__setattr__(
|
setattr(config.namespace, config_item,
|
||||||
config_item, str(renewalparams[config_item]))
|
str(renewalparams[config_item]))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@@ -822,8 +821,7 @@ def _reconstitute(full_path, config):
|
|||||||
# configuration restoring logic is not able to correctly parse it
|
# configuration restoring logic is not able to correctly parse it
|
||||||
# from the serialized form.
|
# from the serialized form.
|
||||||
if "webroot_map" in renewalparams:
|
if "webroot_map" in renewalparams:
|
||||||
config.namespace__setattr__(
|
setattr(config.namespace, "webroot_map", renewalparams["webroot_map"])
|
||||||
"webroot_map", renewalparams["webroot_map"])
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
domains = [le_util.enforce_domain_sanity(x) for x in
|
domains = [le_util.enforce_domain_sanity(x) for x in
|
||||||
@@ -834,7 +832,7 @@ def _reconstitute(full_path, config):
|
|||||||
"invalid. Skipping.", full_path)
|
"invalid. Skipping.", full_path)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
config.namespace__setattr__("domains", domains)
|
setattr(config.namespace, "domains", domains)
|
||||||
return renewal_candidate
|
return renewal_candidate
|
||||||
|
|
||||||
|
|
||||||
@@ -843,7 +841,7 @@ def _renewal_conf_files(config):
|
|||||||
return glob.glob(os.path.join(config.renewal_configs_dir, "*.conf"))
|
return glob.glob(os.path.join(config.renewal_configs_dir, "*.conf"))
|
||||||
|
|
||||||
|
|
||||||
def renew(cli_config, plugins):
|
def renew(cli_config, unused_plugins):
|
||||||
"""Renew previously-obtained certificates."""
|
"""Renew previously-obtained certificates."""
|
||||||
cli_config = configuration.RenewerConfiguration(cli_config)
|
cli_config = configuration.RenewerConfiguration(cli_config)
|
||||||
if cli_config.domains != []:
|
if cli_config.domains != []:
|
||||||
|
|||||||
Reference in New Issue
Block a user