Skip to content

Commit

Permalink
Remove update symlinks (#9592)
Browse files Browse the repository at this point in the history
* Add deprecation warning when update_symlinks is run

* Remove information about update_symlinks from help

* ignore our own warning and remove unused imports

* Update changelog
  • Loading branch information
ohemorange committed Feb 22, 2023
1 parent 2a7eeef commit 1cb48ec
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion certbot/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Certbot adheres to [Semantic Versioning](https://semver.org/).

### Added

*
* We deprecated support for the update_symlinks command. Support will be removed in a following
version of Certbot.

### Changed

Expand Down
2 changes: 1 addition & 1 deletion certbot/certbot/_internal/cli/group_adder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def _add_all_groups(helpful: "helpful.HelpfulArgumentParser") -> None:
helpful.add_group("paths", description="Flags for changing execution paths & servers")
helpful.add_group("manage",
description="Various subcommands and flags are available for managing your certificates:",
verbs=["certificates", "delete", "renew", "revoke", "update_symlinks", "reconfigure"])
verbs=["certificates", "delete", "renew", "revoke", "reconfigure"])

# VERBS
for verb, docs in VERB_HELP:
Expand Down
9 changes: 0 additions & 9 deletions certbot/certbot/_internal/cli/verb_help.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""This module contain help information for verbs supported by certbot"""
from certbot._internal.cli.cli_constants import SHORT_USAGE
from certbot._internal.cli.cli_utils import flag_default
from certbot.compat import os

# The attributes here are:
# short: a string that will be displayed by "certbot -h commands"
Expand Down Expand Up @@ -84,13 +82,6 @@
"opts": 'Options for the "plugins" subcommand',
"usage": "\n\n certbot plugins [options]\n\n"
}),
("update_symlinks", {
"short": "Recreate symlinks in your /etc/letsencrypt/live/ directory",
"opts": ("Recreates certificate and key symlinks in {0}, if you changed them by hand "
"or edited a renewal configuration file".format(
os.path.join(flag_default("config_dir"), "live"))),
"usage": "\n\n certbot update_symlinks [options]\n\n"
}),
("enhance", {
"short": "Add security enhancements to your existing configuration",
"opts": ("Helps to harden the TLS configuration by adding security enhancements "
Expand Down
2 changes: 2 additions & 0 deletions certbot/certbot/_internal/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Tuple
from typing import TypeVar
from typing import Union
import warnings

import configobj
import josepy as jose
Expand Down Expand Up @@ -1279,6 +1280,7 @@ def update_symlinks(config: configuration.NamespaceConfig,
:rtype: None
"""
warnings.warn("update_symlinks is deprecated and will be removed", PendingDeprecationWarning)
cert_manager.update_live_symlinks(config)


Expand Down
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
# unit tests. This warning should be ignored until our (transitive)
# dependency on requests-toolbelt is removed or our pinned version can be
# updated.
# 4) Ignore our own PendingDeprecationWarning about update_symlinks soon to be dropped.
# See https://github.com/certbot/certbot/issues/6284.
filterwarnings =
error
ignore:decodestring\(\) is a deprecated alias:DeprecationWarning:dns
ignore:.*rsyncdir:DeprecationWarning
ignore:'urllib3.contrib.pyopenssl:DeprecationWarning:requests_toolbelt
ignore:update_symlinks is deprecated:PendingDeprecationWarning

0 comments on commit 1cb48ec

Please sign in to comment.