Skip to content

Commit

Permalink
chg: [MAS] Improved the management of the probe agent.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbonhomme committed Dec 21, 2023
1 parent 2285762 commit 9f34e43
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions scandale/probe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import argparse
import asyncio
import base64
import json
import subprocess
Expand Down Expand Up @@ -73,7 +72,7 @@ async def run(self):
self.exit_code = "Job Finished!"

# stop agent from behaviour
# await self.agent.stop()
await self.agent.stop()

async def setup(self):
print("Agent starting . . .")
Expand All @@ -91,17 +90,20 @@ async def main(config):
agent = ProbeEngine(config["jid"], config["passwd"])
agent.config = config
await agent.start()
await agent.InformBehav.join()
print("Stopping agent.")
await agent.stop()

# wait until user interrupts with ctrl+C
while True: # not agent.CollectingBehav.is_killed():
try:
await asyncio.sleep(1)
except KeyboardInterrupt:
break
# while True: # not agent.CollectingBehav.is_killed():
# try:
# await asyncio.sleep(1)
# except KeyboardInterrupt:
# break

# assert agent.InformBehav.exit_code == 10

assert agent.InformBehav.exit_code == 10

await agent.stop()


if __name__ == "__main__":
Expand Down

0 comments on commit 9f34e43

Please sign in to comment.