Skip to content

Suggestion: check file path prior to processing #1

@cherdt

Description

@cherdt

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions