Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-lenormand committed Apr 17, 2024
1 parent 1ba970a commit b57f2a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions parliament/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def find_files(directory, exclude_pattern=None, policy_extension=""):


def main(argv):
with open("/tmp/parliament.log", "w") as fout:
fout.write(f"Argv: {argv}\n")
parser = argparse.ArgumentParser()
parser.add_argument(
"--aws-managed-policies",
Expand Down Expand Up @@ -202,6 +204,9 @@ def main(argv):
)
args = parser.parse_args(args=argv[1:])

with open("/tmp/parliament.log", "a") as fout:
fout.write(f"Files: {args.files}\n")

log_level = logging.ERROR
log_format = "%(message)s"

Expand Down Expand Up @@ -325,6 +330,8 @@ def main(argv):
for file_path in (stripped_path for path in args.files.split(",") if (stripped_path := path.strip())):
path = Path(file_path)
contents = path.read_text()
with open("/tmp/parliament.log", "a") as fout:
fout.write(f"Path: {path}\nContents: {contents}\n")
policy = analyze_policy_string(
contents,
file_path,
Expand Down

0 comments on commit b57f2a1

Please sign in to comment.