From 4cc0390b38f7942e15688dd547229dc23bd4805b Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Mon, 13 Jul 2020 19:26:43 -0700 Subject: check if certbot version will be available post-refresh after all --- certbot-dns-dnsimple/snap/hooks/post-refresh | 12 +++++++++--- certbot-dns-dnsimple/snap/hooks/pre-refresh | 18 +++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/certbot-dns-dnsimple/snap/hooks/post-refresh b/certbot-dns-dnsimple/snap/hooks/post-refresh index 6dbf99b56..301179e73 100644 --- a/certbot-dns-dnsimple/snap/hooks/post-refresh +++ b/certbot-dns-dnsimple/snap/hooks/post-refresh @@ -1,13 +1,19 @@ #!/bin/sh -e # get certbot version -cb_installed="$(snapctl get cb-installed)" +# cb_installed="$(snapctl get cb-installed)" -if [ -z "$cb_installed" ]; then - echo "cb_installed not set, not doing version comparison check" >> "$SNAP_DATA/debuglog" +# if [ -z "$cb_installed" ]; then +# echo "cb_installed not set, not doing version comparison check" >> "$SNAP_DATA/debuglog" +# exit 0 +# fi + +if [ ! -f "$SNAP/certbot-shared/__init__.py" ]; then + echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog" exit 0 fi +cb_installed=$(grep -oP "__version__ = '\K.*(?=')" $SNAP/certbot-shared/__init__.py) echo "cb_installed: $cb_installed" >> "$SNAP_DATA/debuglog" # get required certbot version for plugin diff --git a/certbot-dns-dnsimple/snap/hooks/pre-refresh b/certbot-dns-dnsimple/snap/hooks/pre-refresh index bf1521d22..ea9092ca0 100644 --- a/certbot-dns-dnsimple/snap/hooks/pre-refresh +++ b/certbot-dns-dnsimple/snap/hooks/pre-refresh @@ -1,13 +1,13 @@ #!/bin/sh -e -echo "ls $SNAP/certbot-shared:" >> "$SNAP_DATA/debuglog" -ls $SNAP/certbot-shared >> "$SNAP_DATA/debuglog" +# echo "ls $SNAP/certbot-shared:" >> "$SNAP_DATA/debuglog" +# ls $SNAP/certbot-shared >> "$SNAP_DATA/debuglog" -if [ ! -f "$SNAP/certbot-shared/__init__.py" ]; then - echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog" - exit 0 -fi +# if [ ! -f "$SNAP/certbot-shared/__init__.py" ]; then +# echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog" +# exit 0 +# fi -cb_installed=$(grep -oP "__version__ = '\K.*(?=')" $SNAP/certbot-shared/__init__.py) -echo "cb_installed: $cb_installed" >> "$SNAP_DATA/debuglog" -snapctl set cb-installed="$cb_installed" +# cb_installed=$(grep -oP "__version__ = '\K.*(?=')" $SNAP/certbot-shared/__init__.py) +# echo "cb_installed: $cb_installed" >> "$SNAP_DATA/debuglog" +# snapctl set cb-installed="$cb_installed" -- cgit v1.2.3