Page MenuHomeDevCentral

Allow certbot wrapper to work when no argument is provided after the command
ClosedPublic

Authored by dereckson on Dec 30 2020, 02:19.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 04:23
Unknown Object (File)
Wed, Mar 27, 22:33
Unknown Object (File)
Sat, Mar 23, 11:23
Unknown Object (File)
Fri, Mar 22, 20:01
Unknown Object (File)
Mon, Mar 18, 08:21
Unknown Object (File)
Mon, Mar 18, 08:21
Unknown Object (File)
Mon, Mar 18, 07:58
Unknown Object (File)
Mon, Mar 18, 06:58
Subscribers
None

Details

Summary

Fixes T1640.

Test Plan

Tested on docker-001:

$ certbot renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log
[...]

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Errors
SeverityLocationCodeMessage
Errorroles/paas-docker/wrappers/files/certbot.sh:32SC2068SHELLCHECK
Adviceroles/paas-docker/wrappers/files/certbot.sh:32SC2086SHELLCHECK
Unit
No Test Coverage
Branch
fix-certbot
Build Status
Buildable 3683
Build 3933: arc lint + arc unit

Event Timeline

dereckson created this revision.
Another way to solve this according https://github.com/koalaman/shellcheck/wiki/SC2086:

Quoting this doesn't work, since in the default case, "$debug" would expand to one empty argument while $debug would expand into zero arguments. In this case, you can use an array with zero or one elements as outlined above, or you can use an unquoted expansion with an alternate value:

debug=""
[[ $1 == "--trace-commands" ]] && debug="yes"
bash ${debug:+"-x"} script

This is better than an unquoted value because the alternative value can be properly quoted, e.g. wget ${output:+ -o "$output"}.

This revision is now accepted and ready to land.Dec 30 2020, 02:22
This revision was landed with ongoing or failed builds.Dec 30 2020, 02:23
This revision was automatically updated to reflect the committed changes.