mirror of
https://github.com/certbot/certbot.git
synced 2026-04-22 14:47:13 -04:00
snap: fix generated postrefreshhook script (#9994)
Fixes #9990 If the python oneliner to check certbot's version succeeded, exit_code would never be set, which would cause our exit_code check to fail. Use a check that handles unset exit_code
This commit is contained in:
parent
2660a2017b
commit
165c3e32b0
1 changed files with 1 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ cb_required=\$(grep -oP "version = '\K.*(?=')" \$SNAP/setup.py)
|
|||
|
||||
\$SNAP/bin/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
|
||||
if [ "\$exit_code" = "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."
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue