diff --git a/services/agenthandler.py b/services/agenthandler.py index a2c0959..fcc455e 100644 --- a/services/agenthandler.py +++ b/services/agenthandler.py @@ -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 \ No newline at end of file diff --git a/utils/menus.py b/utils/menus.py index d1aeeac..ba68a7d 100644 --- a/utils/menus.py +++ b/utils/menus.py @@ -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":