Skip to content

Commit

Permalink
handle legacy http01_port value
Browse files Browse the repository at this point in the history
  • Loading branch information
bmw committed Mar 1, 2016
1 parent 429db3f commit ce2d307
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions letsencrypt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ce2d307

Please sign in to comment.