From d612e536f9cddf775d8dc6d323688949e0b90826 Mon Sep 17 00:00:00 2001 From: Alexis Koralewski Date: Thu, 2 Mar 2023 17:37:20 +0100 Subject: [PATCH] Fix Agent, wasn't executing agent specific commands --- src/core/pyros_django/agent/Agent.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/pyros_django/agent/Agent.py b/src/core/pyros_django/agent/Agent.py index 7d3aef5..9a590d3 100755 --- a/src/core/pyros_django/agent/Agent.py +++ b/src/core/pyros_django/agent/Agent.py @@ -642,7 +642,6 @@ class Agent: self.name = agent_name_from_config else: self.name = self.__class__.__name__ - log.addHandler(handler_filebyagent(logging.INFO, self.name)) #log.addHandler(handler_filebyagent(logging.INFO, self.name)) log.debug("start Agent init") @@ -2096,6 +2095,8 @@ class Agent: func = cmd.name if func not in methods_list: cmd.set_as_unimplemented() + else: + cmd_next = cmd # bad/missing/too many args ? => cannot test this because only while executing cmd... # OK, VALID else: @@ -3473,6 +3474,15 @@ class Agent: import argparse def parse_args(args): + """ + Set up argparse parser to parse agent arguments + + Args: + args : args passed to script (sys.argv) + + Returns: + parsed arguments + """ parser = argparse.ArgumentParser(description='Start an agent.') parser.add_argument("--computer",dest="computer",help='Launch agent with simulated computer hostname',action="store") parser.add_argument("-t", action="store_true") -- libgit2 0.21.2