userid-validation: utilize python2
python3 is not available in the current jenkins docker container. Queue
this up for a future jenkins upgrade window.
Change-Id: I07e99a006e890e9e3cb7279c91923a56d0f572e8
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/jenkins/userid-validation b/jenkins/userid-validation
index e6ebebe..2f5d5da 100755
--- a/jenkins/userid-validation
+++ b/jenkins/userid-validation
@@ -21,7 +21,7 @@
echo "Checking ${GERRIT_PROJECT}:${GERRIT_BRANCH}:${GERRIT_CHANGE_ID}:${GERRIT_PATCHSET_REVISION}"
# shellcheck disable=2086 # GERRIT_COMMAND is purposefully wordsplit.
-COMMITTER_EMAIL=$(${GERRIT_COMMAND}/a/changes/${GERRIT_PROJECT/\//%2F}~${GERRIT_BRANCH}~${GERRIT_CHANGE_ID}/revisions/${GERRIT_PATCHSET_REVISION}/commit | python3 -c "import sys, json; sys.stdin.read(4); print(json.load(sys.stdin)['committer']['email'])")
+COMMITTER_EMAIL=$(${GERRIT_COMMAND}/a/changes/${GERRIT_PROJECT/\//%2F}~${GERRIT_BRANCH}~${GERRIT_CHANGE_ID}/revisions/${GERRIT_PATCHSET_REVISION}/commit | python2 -c "import sys, json; sys.stdin.read(4); print(json.load(sys.stdin)['committer']['email'])")
if [ "x${COMMITTER_EMAIL}" == "x" ]; then
echo "Unable to find committer."
"${GERRIT_SSH_CMD[@]}" review \
@@ -32,7 +32,7 @@
#echo "Commit by '${COMMITTER_EMAIL}'"
# shellcheck disable=2086 # GERRIT_COMMAND is purposefully wordsplit.
-COMMITTER_USERNAME=$(${GERRIT_COMMAND}/a/accounts/${COMMITTER_EMAIL} | python3 -c "import sys, json; sys.stdin.read(4); print(json.load(sys.stdin)['username'])")
+COMMITTER_USERNAME=$(${GERRIT_COMMAND}/a/accounts/${COMMITTER_EMAIL} | python2 -c "import sys, json; sys.stdin.read(4); print(json.load(sys.stdin)['username'])")
#COMMITTER_USERNAME=`${GERRIT_COMMAND}/a/accounts/${COMMITTER_EMAIL}`
echo "USERNAME: $COMMITTER_USERNAME"
if [ "x${COMMITTER_USERNAME}" == "x" ]; then