Fix autocorrectinfofile 40/13740/1 v0.19.0
authorAric Gardner <agardner@linuxfoundation.org>
Thu, 29 Nov 2018 18:53:14 +0000 (13:53 -0500)
committerAric Gardner <agardner@linuxfoundation.org>
Thu, 29 Nov 2018 18:56:43 +0000 (13:56 -0500)
get_committers was renamed as get-committers

Change awk field seperator due to change in the output of
lftools infofile get-committers

Change-Id: Ic7bba44956907635434f97399f36da71a9207a1d
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
shell/autocorrectinfofile

index 32f5e4f..97fdb25 100755 (executable)
@@ -106,7 +106,7 @@ main() {
     git clone -q "$gerritclonebase""$repo" "$DIR"/"$repo" || exit 1
   fi
 
-  diff="$(diff <(lftools infofile get_committers "$DIR"/LDAP.yaml 2>&-| sort) <(lftools infofile get_committers "$DIR"/"$repo"/INFO.yaml 2>&- | sort))"
+  diff="$(diff <(lftools infofile get-committers "$DIR"/LDAP.yaml 2>&-| sort) <(lftools infofile get-committers "$DIR"/"$repo"/INFO.yaml 2>&- | sort))"
   status="$?"
 
   diff_array=()
@@ -117,11 +117,11 @@ main() {
     diff_array+=( "$line" )
     if [[ $(echo "$line" | grep ">") ]];
     then
-      onlyinINFO+=( "$(echo "$line" | awk -F"'" '{ print $2 }')" )
+      onlyinINFO+=( "$(echo "$line" | awk -F"id: " '{ print $2 }')" )
     fi
     if [[ $(echo "$line" | grep "<") ]];
     then
-      onlyinLDAP+=( "$(echo "$line" | awk -F"'" '{ print $2 }')" )
+      onlyinLDAP+=( "$(echo "$line" | awk -F"id: " '{ print $2 }')" )
     fi
   done < <(echo "${diff[@]}" )
 
@@ -130,7 +130,7 @@ main() {
     for missing in "${onlyinINFO[@]}"; do
       if ! [ -z "$missing" ]; then
         echo "    DUMMY: sending invite to $missing"
-        lftools infofile get_committers --id "$missing" "$DIR"/"$repo"/INFO.yaml 2>&-
+        lftools infofile get-committers --id "$missing" "$DIR"/"$repo"/INFO.yaml 2>&-
       fi
     done
   fi