]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-ansible-pr-syntax-check: group_vars operator 1113/head
authorSébastien Han <seb@redhat.com>
Tue, 28 Aug 2018 17:23:55 +0000 (10:23 -0700)
committerSébastien Han <seb@redhat.com>
Tue, 28 Aug 2018 17:23:55 +0000 (10:23 -0700)
When defaults/main.yml is touched we will generate 2 group_vars files,
one for all.yml.sample and one for rhcs.yml.sample, this is making the
conditional never pass since there is one more value in the count.

Basically if defaults/main.yml and osd/defaults/main.yml are touched
this will result in 3 group_vars file but the count for
defaults/main.yml is 2.

In the end we want to fail if the number of defaults/main.yml is
greather than the number of group_vars files.

Signed-off-by: Sébastien Han <seb@redhat.com>
ceph-ansible-pr-syntax-check/build/build

index a35f0d16817ffbb33da0d91fdba56603f7c7eb08..a76f3094368650555079f756b09a8f7faa5a304e 100644 (file)
@@ -40,7 +40,7 @@ function group_vars_check {
 
   # we use || true so we still count and don't fail if we don't find anything
   nb_group_vars=$(match_file "group_vars/" | wc -l)
-  if [[ "$nb" -ne "$nb_group_vars" ]]; then
+  if [[ "$nb" -gt "$nb_group_vars" ]]; then
     echo "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."
     return 1