mirror of
https://github.com/openshift/openshift-ansible.git
synced 2026-02-05 15:45:57 +01:00
setup.py: exclude ymls which start with a dot
This would skip .papr.yml, which contains several documents in one
This commit is contained in:
6
setup.py
6
setup.py
@@ -77,7 +77,7 @@ def find_playbooks():
|
||||
exclude_dirs = ('adhoc', 'tasks')
|
||||
for yaml_file in find_files(
|
||||
os.path.join(os.getcwd(), 'playbooks'),
|
||||
exclude_dirs, None, r'\.ya?ml$'):
|
||||
exclude_dirs, None, r'^[^\.].*\.ya?ml$'):
|
||||
with open(yaml_file, 'r') as contents:
|
||||
for task in yaml.safe_load(contents) or {}:
|
||||
if not isinstance(task, dict):
|
||||
@@ -151,7 +151,7 @@ class OpenShiftAnsibleYamlLint(Command):
|
||||
else:
|
||||
format_method = Format.standard_color
|
||||
|
||||
for yaml_file in find_files(os.getcwd(), self.excludes, None, r'\.ya?ml$'):
|
||||
for yaml_file in find_files(os.getcwd(), self.excludes, None, r'^[^\.].*\.ya?ml$'):
|
||||
first = True
|
||||
with open(yaml_file, 'r') as contents:
|
||||
for problem in linter.run(contents, config):
|
||||
@@ -321,7 +321,7 @@ class OpenShiftAnsibleSyntaxCheck(Command):
|
||||
print('Ansible Deprecation Checks')
|
||||
exclude_dirs = ('adhoc', 'files', 'meta', 'vars', 'defaults', '.tox')
|
||||
for yaml_file in find_files(
|
||||
os.getcwd(), exclude_dirs, None, r'\.ya?ml$'):
|
||||
os.getcwd(), exclude_dirs, None, r'^[^\.].*\.ya?ml$'):
|
||||
with open(yaml_file, 'r') as contents:
|
||||
yaml_contents = yaml.safe_load(contents)
|
||||
if not isinstance(yaml_contents, list):
|
||||
|
||||
Reference in New Issue
Block a user