Example #1
0
 def jitter(self, guid, max, min):
     try:
         session = self.get_session(guid)
         if min:
             session.jobs.add(Job(command=('Jitter', [int(max), int(min)])))
         else:
             session.jobs.add(Job(command=('Jitter', [int(max)])))
     except SessionNotFoundError:
         raise CmdError(f"No session named: {guid}")
Example #2
0
 def kill(self, guid):
     try:
         session = self.get_session(guid)
         session.jobs.add(Job(command=('Exit', [])))
         return {'guid': guid, 'status': 'Tasked to exit'}
     except SessionNotFoundError:
         raise CmdError(f"No session named: {guid}")
Example #3
0
 def checkin(self, guid):
     try:
         session = self.get_session(guid)
         session.jobs.add(Job(command=('CheckIn', [])))
     except SessionNotFoundError:
         raise CmdError(f"No session named: {guid}")
Example #4
0
 def sleep(self, guid, interval):
     try:
         session = self.get_session(guid)
         session.jobs.add(Job(command=('Sleep', [int(interval)])))
     except SessionNotFoundError:
         raise CmdError(f"No session named: {guid}")
Example #5
0
 def run(self, guids):
     for guid in guids:
         ipc_server.publish_event(Events.NEW_JOB,
                                  (guid, Job(module=self.selected)))
Example #6
0
 def __init__(self, session):
     self.session = session
     self.jobs = []
     self.jobs.append(Job(command=('CheckIn', [])))