Skip to content

Commit 5ba327e

Browse files
author
Gabriel Monroy
committed
return the body of chef-client even on failed node convergence
1 parent b508280 commit 5ba327e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

api/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,11 @@ def get_queryset(self, **kwargs):
282282

283283
def converge(self, request, **kwargs):
284284
node = self.get_object()
285-
output, _ = node.converge()
285+
try:
286+
output, _ = node.converge()
287+
except RuntimeError as e:
288+
return Response(e.output, status=status.HTTP_500_INTERNAL_SERVER_ERROR,
289+
content_type='text/plain')
286290
return Response(output, status=status.HTTP_200_OK, content_type='text/plain')
287291

288292

0 commit comments

Comments
 (0)