From ce2d307f54c73e27911ea7934957b8a5ec543b1c Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Tue, 1 Mar 2016 11:39:52 -0800 Subject: [PATCH] handle legacy http01_port value --- letsencrypt/cli.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 3551d5a1072..9aa79cfa93a 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -806,12 +806,17 @@ def _restore_required_config_elements(config, renewalparams): # int-valued items to add if they're present for config_item in INT_CONFIG_ITEMS: if config_item in renewalparams and not _set_by_cli(config_item): - try: - value = int(renewalparams[config_item]) - setattr(config.namespace, config_item, value) - except ValueError: - raise errors.Error( - "Expected a numeric value for {0}".format(config_item)) + config_value = renewalparams[config_item] + if config_item == "http01_port" and config_value == "None": + logger.info("updating legacy http01_port value") + int_value = flag_default("http01_port") + else: + try: + int_value = int(config_value) + except ValueError: + raise errors.Error( + "Expected a numeric value for {0}".format(config_item)) + setattr(config.namespace, config_item, int_value) def _restore_plugin_configs(config, renewalparams):