Skip to content

Commit

Permalink
Merge pull request #26 from 0xdabbad00/change_exit_status
Browse files Browse the repository at this point in the history
Just use a 0 or 1 for the exit status, to avoid having a status over 255
  • Loading branch information
0xdabbad00 authored Dec 13, 2019
2 parents 53d8a76 + a16ca09 commit 3f21218
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Notice that the severity of that finding has been changed from a `LOW` to a `MED

Now rename `test.json` to `testa.json` and rerun the command. You will no longer have any output, because we are filtering based on the filepath for `UNKNOWN_ACTION` and filtering for any filepaths that contain `testa.json` or `.py`.

You can also check the exit status with `echo $?` and see the exit status is 0 when there are no findings. The exit status is set to the number of findings (ex. 10 findings results in an exit status of 10).
You can also check the exit status with `echo $?` and see the exit status is 0 when there are no findings. The exit status will be non-zero when there are findings.



Expand Down
2 changes: 1 addition & 1 deletion parliament/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
This library is a linter for AWS IAM policies.
"""
__version__ = "0.3.5"
__version__ = "0.3.6"

import os
import json
Expand Down
3 changes: 2 additions & 1 deletion parliament/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ def main():

for finding in filtered_findings:
print_finding(finding, args.minimal, args.json)

# There were findings, so return with a non-zero exit code
exit(len(filtered_findings))
exit(1)


if __name__ == "__main__":
Expand Down

0 comments on commit 3f21218

Please sign in to comment.