Merge "skip hidden files/dirs on reclass load"
diff --git a/_modules/reclass.py b/_modules/reclass.py
index 3cefbad..62ba405 100644
--- a/_modules/reclass.py
+++ b/_modules/reclass.py
@@ -49,6 +49,10 @@
# find classes
for root, dirs, files in os.walk(path):
+ # skip hidden files and folders in reclass dir
+ files = [f for f in files if not f[0] == '.']
+ dirs[:] = [d for d in dirs if not d[0] == '.']
+ # translate found init.yml to valid class name
if 'init.yml' in files:
class_file = root + '/' + 'init.yml'
class_name = class_file.replace(path, '')[:-9].replace('/', '.')
@@ -252,7 +256,7 @@
salt '*' reclass.node_create server.domain.com classes=[system.neco1, system.neco2]
salt '*' reclass.node_create namespace/test enabled=False
-
+
'''
ret = {}
@@ -344,6 +348,9 @@
ret = {}
for root, sub_folders, files in os.walk(_get_nodes_dir()):
+ # skip hidden files and folders in reclass dir
+ files = [f for f in files if not f[0] == '.']
+ sub_folders[:] = [d for d in dirs if not d[0] == '.']
for fl in files:
file_path = os.path.join(root, fl)
with open(file_path, 'r') as file_handle:
@@ -506,7 +513,7 @@
.. code-block:: bash
salt-call reclass.graph_data
-
+
'''
pillar_data = _pillar_graph_data().get('graph')
grain_data = _grain_graph_data().get('graph')