diff options
author | Erica Portnoy <ebportnoy@gmail.com> | 2022-10-13 01:31:27 +0300 |
---|---|---|
committer | Erica Portnoy <ebportnoy@gmail.com> | 2022-10-13 01:31:27 +0300 |
commit | 5fd18ce2858980559a9bed6ca7c3e86e9a87a54c (patch) | |
tree | 16f002c8d58e1e4007b772906ae5948c0dbba4a8 | |
parent | 92ae44ad4477db66cdf92c7af7fc623257919f94 (diff) |
Add comments and messages
-rw-r--r-- | certbot/certbot/_internal/main.py | 16 | ||||
-rw-r--r-- | certbot/certbot/_internal/storage.py | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/certbot/certbot/_internal/main.py b/certbot/certbot/_internal/main.py index fdbe43bd3..5d233d9b5 100644 --- a/certbot/certbot/_internal/main.py +++ b/certbot/certbot/_internal/main.py @@ -1654,7 +1654,9 @@ def make_or_verify_needed_dirs(config: configuration.NamespaceConfig) -> None: def reconfigure(config: configuration.NamespaceConfig, plugins: plugins_disco.PluginsRegistry) -> None: - """Write me. + """Allow the user to set new configuration options for an existing certificate without + forcing renewal. This can be used for things like authenticator, installer, and hooks, + but not for the domains on the cert, since those are only saved in the cert. :param config: Configuration object :type config: configuration.NamespaceConfig @@ -1674,8 +1676,8 @@ def reconfigure(config: configuration.NamespaceConfig, "with the flag --force-renewal. Otherwise, remove the domains from the command " "to continue reconfiguring. You can specify which certificate you want on the command " "line with flag --cert-name instead.") - # TODO allow domains to be used to specify the certificate in addition to --cert-name, - # only erroring if they do not match the existing ones + # Potential TODO: allow domains to be used to specify the certificate in addition to + # --cert-name, only erroring if they do not match the existing ones # To make sure that the requested changes work, do a dry run. This will have the side effect @@ -1694,14 +1696,14 @@ def reconfigure(config: configuration.NamespaceConfig, certname = config.certname lineage = cert_manager.lineage_for_certname(config, certname) + if not lineage: + raise errors.ConfigurationError("An existing certificate for the given name could not " + "be found. Run `certbot certificates` to list available certificates.") + # renews cert as dry run lineage = _get_and_save_cert(le_client, config, certname=certname, lineage=lineage) - # if not renewed_lineage: - # raise errors.Error("An existing certificate for the given name could not be found.") - lineage.save_new_config_values(config) - # cert_manager.reconfigure(config) @contextmanager diff --git a/certbot/certbot/_internal/storage.py b/certbot/certbot/_internal/storage.py index 7088e08db..812f752b0 100644 --- a/certbot/certbot/_internal/storage.py +++ b/certbot/certbot/_internal/storage.py @@ -1213,7 +1213,7 @@ class RenewableCert(interfaces.RenewableCert): def save_new_config_values(self, cli_config: configuration.NamespaceConfig) -> None: - """Save new cert and chain as a successor of a prior version. + """Save only the config information without writing the new cert. :param .NamespaceConfig cli_config: parsed command line arguments |