Suggestion: check the file path and produce an error before running a series of lengthy API calls.
Steps to reproduce:
- Add a non-existent path to
Sophos_Central_Health.config
- Run
python Sophos_Central_Health.py
An error similar to the following is produced, but only after gathering all the data:
Traceback (most recent call last):
File "Sophos_Central_Health.py", line 672, in <module>
print_report()
File "Sophos_Central_Health.py", line 630, in print_report
with open(full_report_path, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/bad/path/sophos_report_21012022_16-29-09.csv'
Suggestion: check the file path and produce an error before running a series of lengthy API calls.
Steps to reproduce:
Sophos_Central_Health.configpython Sophos_Central_Health.pyAn error similar to the following is produced, but only after gathering all the data: