From 956f37dfd0db391a138f9a8f65d8ebf65a948e96 Mon Sep 17 00:00:00 2001
From: Lyanis SOUIDI <lyanis.souidi@etu.u-pec.fr>
Date: Sat, 21 Dec 2024 12:26:18 +0100
Subject: [PATCH] fix remove acl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- correction command de retrait des ACL
- suppression des tâches en arrière-plan (on essayait de retirer toutes les ACLs en simultané mais la commande timeout)
---
 vm/extract_acl.py | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/vm/extract_acl.py b/vm/extract_acl.py
index b83cdb8..0005e27 100644
--- a/vm/extract_acl.py
+++ b/vm/extract_acl.py
@@ -3,7 +3,6 @@
 import json
 import subprocess
 import sys
-import threading
 
 def extract_acls(vmid_min, vmid_max, output_file, remove_acl=False, append=False):
     print("Fetching ACLs...")
@@ -34,18 +33,10 @@ def extract_acls(vmid_min, vmid_max, output_file, remove_acl=False, append=False
                     f.write(f"{path} {user} {role}\n")
 
                 if (remove_acl):
-                    subprocess.run(["pveum", "acl", "delete", path, users, "--roles", roles])
+                    subprocess.run(["pveum", "acl", "delete", path, "--users", users, "--roles", roles])
 
-    # Process each ACL in background
-    threads = []
     for acl_entry in acls:
-        thread = threading.Thread(target=process_acl, args=(acl_entry,))
-        thread.start()
-        threads.append(thread)
-
-    # Wait for all threads to finish
-    for thread in threads:
-        thread.join()
+        process_acl(acl_entry)
 
     print(f"ACLs extracted and saved to {output_file}")