From 2b51cf8fca959b96a5bfeb229a823ea5db883139 Mon Sep 17 00:00:00 2001 From: pedrooot Date: Tue, 1 Oct 2024 13:57:52 -0600 Subject: [PATCH] feat(inventory): rename inventory to scan-inventory --- docs/tutorials/quick-inventory.md | 2 +- prowler/__main__.py | 2 +- prowler/lib/cli/parser.py | 6 ++++-- prowler/providers/aws/lib/arguments/arguments.py | 2 +- prowler/providers/common/inventory.py | 1 + tests/lib/cli/parser_test.py | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/tutorials/quick-inventory.md b/docs/tutorials/quick-inventory.md index 89ba813e44..0c5654d10f 100644 --- a/docs/tutorials/quick-inventory.md +++ b/docs/tutorials/quick-inventory.md @@ -6,7 +6,7 @@ Prowler allows you to execute a quick inventory to extract the number of resourc Currently, it is only available for AWS provider. -- You can use option `-i`/`--inventory` to execute it: +- You can use option `-i`/`--scan-inventory` to execute it: ```sh prowler -i ``` diff --git a/prowler/__main__.py b/prowler/__main__.py index 68ad0b800c..b75d11a33a 100644 --- a/prowler/__main__.py +++ b/prowler/__main__.py @@ -684,7 +684,7 @@ def prowler(): remove_custom_checks_module(checks_folder, provider) # Run the quick inventory for the provider if available - if hasattr(args, "inventory") and args.inventory: + if hasattr(args, "scan_inventory") and args.scan_inventory: run_prowler_inventory(checks_to_execute, args.provider) sys.exit() diff --git a/prowler/lib/cli/parser.py b/prowler/lib/cli/parser.py index 9c62b6bbb8..809a6b447e 100644 --- a/prowler/lib/cli/parser.py +++ b/prowler/lib/cli/parser.py @@ -380,9 +380,11 @@ Detailed documentation at https://docs.prowler.com ) def __init_inventory_parser__(self): - inventory_parser = self.common_providers_parser.add_argument_group("Inventory") + inventory_parser = self.common_providers_parser.add_argument_group( + "ScanInventory" + ) inventory_parser.add_argument( - "--inventory", + "--scan-inventory", action="store_true", help="Run Prowler in inventory mode", ) diff --git a/prowler/providers/aws/lib/arguments/arguments.py b/prowler/providers/aws/lib/arguments/arguments.py index cd6014d030..471d3a16c7 100644 --- a/prowler/providers/aws/lib/arguments/arguments.py +++ b/prowler/providers/aws/lib/arguments/arguments.py @@ -95,7 +95,7 @@ def init_parser(self): # AWS Quick Inventory aws_quick_inventory_subparser = aws_parser.add_argument_group("Inventory") aws_quick_inventory_subparser.add_argument( - "--inventory", + "--scan-inventory", "-i", action="store_true", help="Run Prowler Inventory. The inventory will be stored in an output json file.", diff --git a/prowler/providers/common/inventory.py b/prowler/providers/common/inventory.py index fac27319cd..134d5533bf 100644 --- a/prowler/providers/common/inventory.py +++ b/prowler/providers/common/inventory.py @@ -10,6 +10,7 @@ from tqdm import tqdm def run_prowler_inventory(checks_to_execute, provider): + print(f"\nRunning scan inventory for {provider}") output_folder_path = f"./output/inventory/{provider}" meta_json_file = {} diff --git a/tests/lib/cli/parser_test.py b/tests/lib/cli/parser_test.py index f51be0c997..07a31f482f 100644 --- a/tests/lib/cli/parser_test.py +++ b/tests/lib/cli/parser_test.py @@ -974,7 +974,7 @@ class Test_Parser: assert parsed.quick_inventory def test_aws_parser_quick_inventory_long(self): - argument = "--inventory" + argument = "--scan-inventory" command = [prowler_command, argument] parsed = self.parser.parse(command) assert parsed.quick_inventory