From c173e7c693cce3abd710625820e07934c7edd172 Mon Sep 17 00:00:00 2001 From: Bulat Gaifullin Date: Mon, 19 Sep 2016 13:21:55 +0300 Subject: [PATCH] Fixed handle 'none' value for argument 'nodes' in /graph/execute/ Change-Id: I304f79da0393891b547b5314cb549234a49c935c Closes-Bug: 1625110 --- nailgun/nailgun/api/v1/validators/deployment_graph.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nailgun/nailgun/api/v1/validators/deployment_graph.py b/nailgun/nailgun/api/v1/validators/deployment_graph.py index 3b0b3bf4f4..676fd7b23b 100644 --- a/nailgun/nailgun/api/v1/validators/deployment_graph.py +++ b/nailgun/nailgun/api/v1/validators/deployment_graph.py @@ -45,9 +45,10 @@ class GraphExecuteParamsValidator(BasicValidator): nodes_to_check = set() for graph in parsed['graphs']: - nodes_to_check.update(graph.get('nodes', [])) + nodes_to_check.update(graph.get('nodes') or []) - cls.validate_nodes(nodes_to_check, parsed['cluster']) + if nodes_to_check: + cls.validate_nodes(nodes_to_check, parsed['cluster']) return parsed @classmethod