Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErica Portnoy <ebportnoy@gmail.com>2020-07-22 00:09:04 +0300
committerErica Portnoy <ebportnoy@gmail.com>2020-07-22 00:09:04 +0300
commite3f12df03b56a2a617ec7456f8f5b5be5848d72e (patch)
tree90923e1f487bf78c5c5a5e6853d600ad86bd6a7d /certbot-dns-dnsimple/snap/hooks/post-refresh
parentbbda2016edbdc03c1e2fd6f290357077a59de0b0 (diff)
switch to using packaging.version.parse instead of LooseVersion
Diffstat (limited to 'certbot-dns-dnsimple/snap/hooks/post-refresh')
-rw-r--r--certbot-dns-dnsimple/snap/hooks/post-refresh5
1 files changed, 3 insertions, 2 deletions
diff --git a/certbot-dns-dnsimple/snap/hooks/post-refresh b/certbot-dns-dnsimple/snap/hooks/post-refresh
index 3ae7ef9c7..dd15794a4 100644
--- a/certbot-dns-dnsimple/snap/hooks/post-refresh
+++ b/certbot-dns-dnsimple/snap/hooks/post-refresh
@@ -10,8 +10,9 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin
cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py)
-python3 -c "from distutils.version import LooseVersion; import sys; sys.exit(1) if\
- LooseVersion('$cb_installed') < LooseVersion('$cb_required') else sys.exit(0)" || exit_code=$?
+
+python3 -c "import sys; from packaging import version; sys.exit(1) if\
+ version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" \
"this plugin can be updated; will try again on next refresh."