summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2020-06-11 20:40:07 +0200
committerMatt Clay <matt@mystile.com>2020-06-11 20:57:58 +0200
commit2251b239a315d0a5119e8a31dc0be629861205c0 (patch)
tree5cc673e9e1e051cb9bb1da902033c9058e95b621
parentupdated requirements file for docs build (#70020) (diff)
downloadansible-2251b239a315d0a5119e8a31dc0be629861205c0.tar.xz
ansible-2251b239a315d0a5119e8a31dc0be629861205c0.zip
Fix changelog sanity test config detection.
-rwxr-xr-xtest/lib/ansible_test/_data/sanity/code-smell/changelog.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/lib/ansible_test/_data/sanity/code-smell/changelog.py b/test/lib/ansible_test/_data/sanity/code-smell/changelog.py
index e6c9466240..2a963d5f9b 100755
--- a/test/lib/ansible_test/_data/sanity/code-smell/changelog.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/changelog.py
@@ -11,12 +11,13 @@ def main():
paths = sys.argv[1:] or sys.stdin.read().splitlines()
allowed_extensions = ('.yml', '.yaml')
+ config_path = 'changelogs/config.yaml'
- has_config = False
+ # config must be detected independent of the file list since the file list only contains files under test (changed)
+ has_config = os.path.exists(config_path)
paths_to_check = []
for path in paths:
- if path == 'changelogs/config.yaml':
- has_config = True
+ if path == config_path:
continue
if path.startswith('changelogs/fragments/.'):