From 3183b0c40f039f50eb8267e278ceeda504a2df8f Mon Sep 17 00:00:00 2001 From: Lyanis Souidi <lyanis.souidi@u-pec.fr> Date: Wed, 8 Jan 2025 17:42:00 +0100 Subject: [PATCH] Ajout detail usage commandes import/export acl --- vm/{extract_acl.py => export_acl.py} | 11 ++++++++++- vm/import_acl.py | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) rename vm/{extract_acl.py => export_acl.py} (78%) diff --git a/vm/extract_acl.py b/vm/export_acl.py similarity index 78% rename from vm/extract_acl.py rename to vm/export_acl.py index f99ed33..9f68aeb 100755 --- a/vm/extract_acl.py +++ b/vm/export_acl.py @@ -43,7 +43,16 @@ def extract_acls(vmid_min, vmid_max, output_file, remove_acl=False, append=False def main(): if len(sys.argv) < 4: - print(f"Usage: {sys.argv[0]} <vmid_min> <vmid_max> <output_file> --remove --append") + print(f"Usage: {sys.argv[0]} <vmid_min> <vmid_max> <output_file> [--remove] [--append]") + print(""" +Arguments: + vmid_min - Minimum VMID to extract ACLs from + vmid_max - Maximum VMID to extract ACLs from + output_file - File to save the extracted ACLs to + +Options (order doesn't matter but must be after the arguments): + --remove - Remove the ACLs after extracting them + --append - Append to the output file instead of overwriting it""") sys.exit(1) vmid_min = int(sys.argv[1]) diff --git a/vm/import_acl.py b/vm/import_acl.py index 98f4f76..d9c8f7d 100755 --- a/vm/import_acl.py +++ b/vm/import_acl.py @@ -29,6 +29,14 @@ def import_acls(input_file): def main(): if len(sys.argv) != 2: print(f"Usage: {sys.argv[0]} <input_file>") + print(""" +Arguments: + input_file - File containing ACLs to import + +Input file format: + <acl-path> <user>@<realm> <role> + <acl-path> <user>@<realm> <role> + ...""") sys.exit(1) input_file = sys.argv[1]