Skip to content

Commit 9f18138

Browse files
committed
Merge pull request #360 from opdemand/show-node-converge-error
Return the body of chef-client even on failed node convergence
2 parents 1a57742 + 5ba327e commit 9f18138

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)