Commit d612e536f9cddf775d8dc6d323688949e0b90826

Authored by Alexis Koralewski
1 parent 7d888027
Exists in dev

Fix Agent, wasn't executing agent specific commands

Showing 1 changed file with 11 additions and 1 deletions   Show diff stats
src/core/pyros_django/agent/Agent.py
... ... @@ -642,7 +642,6 @@ class Agent:
642 642 self.name = agent_name_from_config
643 643 else:
644 644 self.name = self.__class__.__name__
645   -
646 645 log.addHandler(handler_filebyagent(logging.INFO, self.name))
647 646 #log.addHandler(handler_filebyagent(logging.INFO, self.name))
648 647 log.debug("start Agent init")
... ... @@ -2096,6 +2095,8 @@ class Agent:
2096 2095 func = cmd.name
2097 2096 if func not in methods_list:
2098 2097 cmd.set_as_unimplemented()
  2098 + else:
  2099 + cmd_next = cmd
2099 2100 # bad/missing/too many args ? => cannot test this because only while executing cmd...
2100 2101 # OK, VALID
2101 2102 else:
... ... @@ -3473,6 +3474,15 @@ class Agent:
3473 3474 import argparse
3474 3475  
3475 3476 def parse_args(args):
  3477 + """
  3478 + Set up argparse parser to parse agent arguments
  3479 +
  3480 + Args:
  3481 + args : args passed to script (sys.argv)
  3482 +
  3483 + Returns:
  3484 + parsed arguments
  3485 + """
3476 3486 parser = argparse.ArgumentParser(description='Start an agent.')
3477 3487 parser.add_argument("--computer",dest="computer",help='Launch agent with simulated computer hostname',action="store")
3478 3488 parser.add_argument("-t", action="store_true")
... ...