cisagov / ScubaGoggles

SCuBA Security Configuration Baselines and assessment tool for Google Workspace
https://www.cisa.gov/resources-tools/services/secure-cloud-business-applications-scuba-project
Creative Commons Zero v1.0 Universal
128 stars 13 forks source link

Stop execution on invalid OS #284

Closed adhilto closed 1 month ago

adhilto commented 1 month ago

๐Ÿ—ฃ Description

Stop execution if an invalid OS is encountered (to fix linter error).

๐Ÿ’ญ Motivation and context

Pylint was warning that url and filename on line 189 (now line 190) might not be defined. This is because url and filename are not defined in the preceding else condition. Stopping execution in this case resolves the issue.

๐Ÿงช Testing

Ran download_opa.py after hardcoding args.os to an invalid value. Note that simply specifying an invalid choice via the commandline won't work because argparse already forces you to choose a valid choice...meaning this whole fix is really a defensive programming thing.

โœ… Pre-approval checklist

โœ… Pre-merge Checklist

โœ… Post-merge Checklist