diff --git a/src/api-service/__app__/node/__init__.py b/src/api-service/__app__/node/__init__.py index c58c929032..78a9310c6c 100644 --- a/src/api-service/__app__/node/__init__.py +++ b/src/api-service/__app__/node/__init__.py @@ -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: @@ -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() diff --git a/src/api-service/__app__/onefuzzlib/workers/nodes.py b/src/api-service/__app__/onefuzzlib/workers/nodes.py index b281fe393c..9c703b84ac 100644 --- a/src/api-service/__app__/onefuzzlib/workers/nodes.py +++ b/src/api-service/__app__/onefuzzlib/workers/nodes.py @@ -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: