fix remove acl
- 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)
This commit is contained in:
parent
ac6fc7c6bf
commit
956f37dfd0
@ -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}")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user