]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commit
ceph-ansible-syntax: display matched files in group_vars_check 1175/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 24 Oct 2018 12:59:14 +0000 (14:59 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 24 Oct 2018 13:26:29 +0000 (15:26 +0200)
commite2b3652d009c210d150a56dd2c9842f99a48b53c
tree98de878cf7b3c9ffcfbf08d8a29beea32a4e9cb9
parentf913dfa80bfffa465dd41e56e01d9807624a698b
ceph-ansible-syntax: display matched files in group_vars_check

it can be useful to see which files have matched in `group_vars_check()`
function.
I'm currently facing an issue where the CI complains on that check while
it doesn't on an other environment when trying to reproduce the issue.

on the CI:

```
+ group_vars_check
++ match_file /defaults/main.yml
++ git_diff_to_head
++ wc -l
++ git diff origin/master..HEAD -- . ':(exclude)roles/*/meta/*'
++ sed -n 's|^+++.*\(/defaults/main.yml.*\)|\1|p'
+ nb=1
+ [[ 1 -eq 0 ]]
++ match_file group_vars/
++ wc -l
++ git_diff_to_head
++ git diff origin/master..HEAD -- . ':(exclude)roles/*/meta/*'
++ sed -n 's|^+++.*\(group_vars/.*\)|\1|p'
+ nb_group_vars=0
+ [[ 1 -gt 0 ]]
+ echo 'One or more files containing default variables has/have been modified.'
One or more files containing default variables has/have been modified.
+ echo 'You must run '\''generate_group_vars_sample.sh'\'' to generate the group_vars template files.'
You must run 'generate_group_vars_sample.sh' to generate the group_vars template files.
+ return 1
```

local env:

```
+ group_vars_check
++ match_file /defaults/main.yml
++ wc -l
++ git_diff_to_head
++ sed -n 's|^+++.*\(/defaults/main.yml.*\)|\1|p'
++ git diff origin/master..HEAD -- . ':(exclude)roles/*/meta/*'
+ nb=0
+ [[ 0 -eq 0 ]]
+ echo 'group_vars has not been touched.'
group_vars has not been touched.
+ return 0
```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
ceph-ansible-pr-syntax-check/build/build