]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
sync-pull: use jq instead of python 2124/head
authorKen Dreyer <kdreyer@redhat.com>
Thu, 6 Apr 2023 16:09:57 +0000 (12:09 -0400)
committerKen Dreyer <kdreyer@redhat.com>
Thu, 6 Apr 2023 16:09:57 +0000 (12:09 -0400)
We installed jq on the signer host so we do not need /usr/bin/python

scripts/sync-pull

index 87d98c07bb0232468d0306389ca9580f05db9500..15633c54c2136bfd90e37a2d0416bfec8705e702 100755 (executable)
@@ -29,9 +29,8 @@ echo "Found the most packages ($current_highest_count) in $highest_combo."
 need_rerun=false
 for endpoint in https://chacra.ceph.com/repos/$project/$release/$sha1/centos/{7,8,9} https://chacra.ceph.com/repos/$project/$release/$sha1/$highest_combo; do
   chacra_repo_status=$(curl -s -L $endpoint)
-  # python is only used here because jq isn't installed on the signer box
-  chacra_needs_update=$(echo $chacra_repo_status | python -mjson.tool | grep needs_update | awk '{ print $2 }' | sed 's/,$//')
-  chacra_is_updating=$(echo $chacra_repo_status | python -mjson.tool | grep is_updating | awk '{ print $2 }' | sed 's/,$//')
+  chacra_needs_update=$(echo $chacra_repo_status | jq .needs_update)
+  chacra_is_updating=$(echo $chacra_repo_status  | jq .is_updating)
 
   if [ "$chacra_needs_update" == "true" ] || [ "$chacra_is_updating" == "true" ]; then
     need_rerun=true
@@ -45,7 +44,7 @@ if [[ "$release" =~ ^[a-n].* ]]; then
 else
   newgen=true
   # Get numerical version number (we only need this with Octopus or later because of the new directory/path scheme).
-  version=$(echo $chacra_repo_status | python -mjson.tool | grep \"version\" | awk '{ print $2 }' | sed 's/"//g')
+  version=$(echo $chacra_repo_status | jq -r .extra.version)
   [[ -d /opt/repos/$project/$release-$version ]] | mkdir -p /opt/repos/$project/$release-$version/{debian/jessie,centos/{7,8,9}}
 fi