From 656944f1cedd3c4b20d5f5a18b9544fa6b670922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 1 Nov 2016 13:57:04 +0100 Subject: [PATCH] Allow add_to_project() to take generator for node types --- pillar/api/utils/node_type_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pillar/api/utils/node_type_utils.py b/pillar/api/utils/node_type_utils.py index 4e03285f..2326c1c7 100644 --- a/pillar/api/utils/node_type_utils.py +++ b/pillar/api/utils/node_type_utils.py @@ -1,5 +1,6 @@ import copy import logging +import types log = logging.getLogger(__name__) @@ -61,7 +62,8 @@ def add_to_project(project, node_types, replace_existing): """ assert isinstance(project, dict) - assert isinstance(node_types, (list, set, frozenset, tuple)) + assert isinstance(node_types, (list, set, frozenset, tuple, types.GeneratorType)), \ + 'node_types is of wrong type %s' % type(node_types) project_id = project['_id']