From 1536c8fca3252aeb4dcd28b0cd2c881b322c48a7 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 3 Feb 2016 19:29:27 -0800 Subject: [PATCH] Fix the things I broke --- letsencrypt/cli.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index caf6d677c..7911ba999 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -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! if 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 for config_item in INT_CONFIG_ITEMS: if config_item in renewalparams: try: value = int(renewalparams[config_item]) - config.namespace__setattr__(config_item, value) + setattr(config.namespace, config_item, value) except ValueError: logger.warning("Renewal configuration file %s specifies " "a non-numeric value for %s. Skipping.", @@ -766,18 +766,17 @@ def _restore_plugin_configs(config, renewalparams): # trying to read the file called "None") # Should we omit the item entirely rather than setting # its value to None? - config.namespace__setattr__(config_item, None) + setattr(config.namespace, config_item, None) continue if config_item.startswith(plugin_prefix + "_"): for action in _parser.parser._actions: # pylint: disable=protected-access if action.type is not None and action.dest == config_item: - config.namespace__setattr__( - config_item, - action.type(renewalparams[config_item])) + setattr(config.namespace, config_item, + action.type(renewalparams[config_item])) break else: - config.namespace__setattr__( - config_item, str(renewalparams[config_item])) + setattr(config.namespace, config_item, + str(renewalparams[config_item])) return True @@ -822,8 +821,7 @@ def _reconstitute(full_path, config): # configuration restoring logic is not able to correctly parse it # from the serialized form. if "webroot_map" in renewalparams: - config.namespace__setattr__( - "webroot_map", renewalparams["webroot_map"]) + setattr(config.namespace, "webroot_map", renewalparams["webroot_map"]) try: domains = [le_util.enforce_domain_sanity(x) for x in @@ -834,7 +832,7 @@ def _reconstitute(full_path, config): "invalid. Skipping.", full_path) return None - config.namespace__setattr__("domains", domains) + setattr(config.namespace, "domains", domains) return renewal_candidate @@ -843,7 +841,7 @@ def _renewal_conf_files(config): 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.""" cli_config = configuration.RenewerConfiguration(cli_config) if cli_config.domains != []: