"""
Run TFSSecurity from Python
"""
import subprocess
import argparse
PARSER = argparse.ArgumentParser()
PARSER.add_argument("--organization", type=str, required=True)
PARSER.add_argument("--projectId", type=str, required=True)
ARGS = PARSER.parse_args()
CMD = [
"C:\\Program Files\\Azure DevOps Server 2019\\Tools\\TFSSecurity.exe",
"/g",
f"vstfs:///Classification/TeamProject/{ARGS.projectId}",
f"/collection:{ARGS.organization}",
]
CLI_OUTPUT = subprocess.run(
CMD, check=True, stdout=subprocess.PIPE, shell=True
).stdout.decode("utf-8")
print(f"[INFO] CLI_OUTPUT: {CLI_OUTPUT}")