Commit a3ea1d09576cdd6f33bfd5ad53b91e5bd81cfd7e

Authored by Alexis Koralewski
1 parent fe7cc30a
Exists in dev

fix agent detail loading

Showing 1 changed file with 6 additions and 3 deletions   Show diff stats
src/core/pyros_django/dashboard/views.py
... ... @@ -204,13 +204,16 @@ def agent_detail(request, agent_name):
204 204 if not AgentSurvey.objects.get(name=agent_name).is_stopping():
205 205 agent_specific_cmds = AgentCmd.send_cmd_from_to("System",agent_name,"get_specific_cmds")
206 206 wait_time = 0
207   - max_wait_time = 10
  207 + max_wait_time = 20
208 208 unimplemented_command = None
209   - while not AgentCmd.objects.get(id=agent_specific_cmds.id).is_executed() and wait_time <= max_wait_time:
  209 + #while not AgentCmd.objects.get(id=agent_specific_cmds.id).is_executed() and wait_time <= max_wait_time:
  210 + while not AgentCmd.objects.get(id=agent_specific_cmds.id).is_executed() and not AgentCmd.objects.get(id=agent_specific_cmds.id).is_exec_error():
210 211 time.sleep(0.5)
  212 + print(AgentCmd.objects.get(id=agent_specific_cmds.id))
211 213 wait_time += 0.5
212 214 cmd = AgentCmd.objects.get(id=agent_specific_cmds.id)
213   - if cmd.is_unimplemented():
  215 + print(cmd)
  216 + if cmd.is_exec_error():
214 217 unimplemented_command = cmd.result
215 218 else:
216 219 agent_specific_cmd_to_list = cmd.result.split(";")
... ...