Workflow upgrade for Move Audit/Enforcement

This commit is contained in:
2025-10-27 12:56:40 -04:00
parent f7ae588502
commit 07021fe072
2 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -283,4 +283,5 @@ def moveAgentToRelatedPolicy(
logger.error(f"Unknown mode '{mode}'. Use 'audit' or 'enforcement'.")
return
api.agent_move(agent.agentid, target_policy)
result = api.agent_move(agent.agentid, target_policy)
return result
+5 -3
View File
@@ -72,10 +72,10 @@ def menu_main(api: AirlockAPIWrapper):
elif choice == "2":
menu_otp(api)
elif choice == "3":
choices = ["audit", "enforcement", "Cancel"]
choices = ["audit", "enforcement", "Exit"]
print(colorText("Move devices to which state?:", "yellow"))
direction = Selector.select_string(choices, False, False)
if direction == "Cancel":
if direction == "Exit":
pass
else:
devices = selectAgents(api)
@@ -85,7 +85,9 @@ def menu_main(api: AirlockAPIWrapper):
confirm = Selector.confirm()
if direction and devices and confirm:
for device in devices:
moveAgentToRelatedPolicy(api,device, str(direction))
result = moveAgentToRelatedPolicy(api,device, str(direction))
logger.info(f"{device.hostname}: result: {result}")
get_sanitized_input("Press enter to continue")
elif choice == "4":
findAgents(api,False)
elif choice == "5":