Update salt adapter to allow ignore_class_notfound config
diff --git a/reclass/adapters/salt.py b/reclass/adapters/salt.py
index 1b45823..f4f331b 100755
--- a/reclass/adapters/salt.py
+++ b/reclass/adapters/salt.py
@@ -24,7 +24,8 @@
nodes_uri=OPT_NODES_URI,
classes_uri=OPT_CLASSES_URI,
class_mappings=None,
- propagate_pillar_data_to_reclass=False):
+ propagate_pillar_data_to_reclass=False,
+ ignore_class_notfound=False):
nodes_uri, classes_uri = path_mangler(inventory_base_uri,
nodes_uri, classes_uri)
@@ -33,7 +34,8 @@
input_data = None
if propagate_pillar_data_to_reclass:
input_data = pillar
- reclass = Core(storage, class_mappings, input_data=input_data)
+ reclass = Core(storage, class_mappings, input_data=input_data,
+ ignore_class_notfound=ignore_class_notfound)
data = reclass.nodeinfo(minion_id)
params = data.get('parameters', {})
@@ -48,13 +50,14 @@
def top(minion_id, storage_type=OPT_STORAGE_TYPE,
inventory_base_uri=OPT_INVENTORY_BASE_URI, nodes_uri=OPT_NODES_URI,
classes_uri=OPT_CLASSES_URI,
- class_mappings=None):
+ class_mappings=None, ignore_class_notfound=False):
nodes_uri, classes_uri = path_mangler(inventory_base_uri,
nodes_uri, classes_uri)
storage = get_storage(storage_type, nodes_uri, classes_uri,
default_environment='base')
- reclass = Core(storage, class_mappings, input_data=None)
+ reclass = Core(storage, class_mappings, input_data=None,
+ ignore_class_notfound=ignore_class_notfound)
# if the minion_id is not None, then return just the applications for the
# specific minion, otherwise return the entire top data (which we need for