Closed battleoverflow closed 1 year ago
@azazelm3dj3d How would you feel about implementing the verbose flag as a standard getopt style -v
?
I plan to add argparse once I've thoroughly tested everything, so that'll be the default way to access arguments other than the file name
I plan to add argparse once I've thoroughly tested everything, so that'll be the default way to access arguments other than the file name
@azazelm3dj3d Makes sense! I'd like to consider folding this in as supported functionality in the main ThreatIngestor command line tool (and yamllint into the list of installed dependencies).
Do you have output or screenshot of running the validator against a config file and showing success and/or failure? Review looks good to me, I think that type of output would be good to include for reviews going forward.
@azazelm3dj3d Makes sense! I'd like to consider folding this in as supported functionality in the main ThreatIngestor command line tool (and yamllint into the list of installed dependencies).
The main ThreatIngestor codebase already checks for errors in the configuration during execution, it's just not as elegant as this script. As for yamllint, we can add it as a dependency, but as far as I know, it can't be used as a library, so it would just clutter up the core dependencies. If anything, it should be installed on an as-use basis since it's an independent script.
@dspruell-i01 Added more checks and improved output. No longer uses the -v
flag since the whole point is to notify the user based on the validation response.
Prerequisites:
yamllint
installed (https://pypi.org/project/yamllint/)How to test:
validate.py
script against theconfig.yml
file (python3 scripts/validate.py config.yml
)python3 scripts/validate.py config.yml v
)