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." diff --git a/certbot-dns-dnsimple/snap/snapcraft.yaml b/certbot-dns-dnsimple/snap/snapcraft.yaml index ebbafd432..a8b630bfe 100644 --- a/certbot-dns-dnsimple/snap/snapcraft.yaml +++ b/certbot-dns-dnsimple/snap/snapcraft.yaml @@ -20,6 +20,7 @@ parts: plugin: dump source: . stage: [setup.py, certbot-shared] + stage-packages: [python3-packaging] override-pull: | snapcraftctl pull mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared