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)
Sat, Nov 16, 04:50
Unknown Object (File)
Sat, Nov 16, 02:44
Unknown Object (File)
Tue, Nov 12, 11:24
Unknown Object (File)
Tue, Nov 12, 01:06
Unknown Object (File)
Mon, Nov 4, 07:10
Unknown Object (File)
Thu, Oct 31, 09:46
Unknown Object (File)
Thu, Oct 31, 02:50
Unknown Object (File)
Tue, Oct 29, 14:44
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.