Improve error messaging for accessing review.o.o

If the default OS user id does not match your gerrit username you
receive a blanket permission denied error message if retrieving the
list of gerrit projects fails.

This attempts to better identify the username, and provide a more
meaningful error message if the list projects function fails.

Change-Id: Ib05d3e7e4d772f42ad94d362bf34b4a36fc5cceb
This commit is contained in:
Ronald Bradford 2015-08-31 13:37:14 -04:00
parent dcfc9336e7
commit 141c240507
1 changed files with 12 additions and 0 deletions

View File

@ -168,6 +168,18 @@ projects="$*"
if [ -z "$projects" ]
then
projects=$(ssh review.openstack.org -p 29418 gerrit ls-projects | grep -v 'attic')
RC=$?
if [ $RC -ne 0 ]
then
echo "Unable to obtain a list of projects from gerrit. Check your ssh credientials for review.openstack.org"
userid=`id -un`
gerrit_userid=`git config --get gitreview.username`
if [ $userid != $gerrit_userid ]
then
echo "Identified a possible userid difference between $userid and $gerrit_userid"
fi
exit $RC
fi
else
# Go ahead and set things up so we will work with stackforge
# repositories, in case the caller has specified one on the