Skip to content

Commit

Permalink
refactor: decoupled strike run status literal from cli
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Nov 19, 2024
1 parent 73f489b commit abc521a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dreadnode_cli/agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def deploy(
return

with Live(formatted, refresh_per_second=2) as live:
while run.status not in ["completed", "failed", "timeout"]:
while run.is_running():
time.sleep(1)
run = client.get_strike_run(run.id)
live.update(format_run(run))
Expand Down
3 changes: 3 additions & 0 deletions dreadnode_cli/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ class _StrikeRun(BaseModel):
start: datetime | None
end: datetime | None

def is_running(self) -> bool:
return self.status not in ["completed", "failed", "timeout", "terminated"]

class StrikeRunSummaryResponse(_StrikeRun):
zones: list["Client.StrikeRunZoneSummary"]

Expand Down

0 comments on commit abc521a

Please sign in to comment.