From b57f2a10feed03b9c36988eddf3094686a8cfadb Mon Sep 17 00:00:00 2001 From: Frank Lenormand Date: Fri, 12 Apr 2024 10:44:16 +0200 Subject: [PATCH] test --- parliament/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/parliament/cli.py b/parliament/cli.py index bd01eae..2748242 100755 --- a/parliament/cli.py +++ b/parliament/cli.py @@ -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", @@ -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" @@ -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,