Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
make user triggered reimaging happen immediately (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc-msft authored Feb 18, 2021
1 parent 21f08f6 commit 929d9ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api-service/__app__/node/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
def patch(req: func.HttpRequest) -> func.HttpResponse:
request = parse_request(NodeGet, req)
if isinstance(request, Error):
return not_ok(request, context="NodeRestart")
return not_ok(request, context="NodeReimage")

node = Node.get_by_machine_id(request.machine_id)
if not node:
Expand All @@ -94,7 +94,7 @@ def patch(req: func.HttpRequest) -> func.HttpResponse:
context=request.machine_id,
)

node.stop()
node.stop(done=True)
if node.debug_keep_node:
node.debug_keep_node = False
node.save()
Expand Down
4 changes: 2 additions & 2 deletions src/api-service/__app__/onefuzzlib/workers/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ def add_ssh_public_key(self, public_key: str) -> Result[None]:
)
return None

def stop(self) -> None:
self.to_reimage()
def stop(self, done: bool = False) -> None:
self.to_reimage(done=done)
self.send_message(NodeCommand(stop=StopNodeCommand()))

def set_shutdown(self) -> None:
Expand Down

0 comments on commit 929d9ce

Please sign in to comment.