From 00e0ddbbe3002a2a8596f9a9aabc1182f667fa7e Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Sun, 9 Jul 2017 21:58:14 -0700 Subject: [PATCH] [Install] Fix postgresql installation DBTYPE should be postgresql not postgres This patch as well sets explicitly driver psycorg2 which removes warnings from sqlalchemy Change-Id: I8c4e2f1a28ff18ec571c3b66914efb78884739a3 --- install_rally.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/install_rally.sh b/install_rally.sh index 9faf491a9b..0a6cffe48b 100755 --- a/install_rally.sh +++ b/install_rally.sh @@ -179,16 +179,16 @@ $GREEN -R, --no-recreate $NO_COLOR Do not remove target directory if it alr $GREEN -y, --yes $NO_COLOR Do not ask for confirmation: assume a 'yes' reply to every question. $GREEN -D, --dbtype TYPE $NO_COLOR Select the database type. TYPE can be one of - 'sqlite', 'mysql', 'postgres'. + 'sqlite', 'mysql', 'postgresql'. Default: sqlite $GREEN --db-user USER $NO_COLOR Database user to use. Only used when --dbtype - is either 'mysql' or 'postgres'. + is either 'mysql' or 'postgresql'. $GREEN --db-password PASSWORD$NO_COLOR Password of the database user. Only used when - --dbtype is either 'mysql' or 'postgres'. + --dbtype is either 'mysql' or 'postgresql'. $GREEN --db-host HOST $NO_COLOR Database host. Only used when --dbtype is - either 'mysql' or 'postgres' + either 'mysql' or 'postgresql' $GREEN --db-name NAME $NO_COLOR Name of the database. Only used when --dbtype is - either 'mysql' or 'postgres' + either 'mysql' or 'postgresql' $GREEN -p, --python EXE $NO_COLOR The python interpreter to use. Default: $PYTHON $GREEN --develop $NO_COLOR Install Rally with editable source code try. (Default: false) @@ -398,7 +398,7 @@ install_db_connector () { mysql) pip install pymysql ;; - postgres) + postgresql) pip install psycopg2 ;; esac @@ -536,7 +536,7 @@ do shift DBTYPE=$1 case $DBTYPE in - sqlite|mysql|postgres);; + sqlite|mysql|postgresql);; *) print_usage | die $EX_USAGE \ "An invalid option has been detected." @@ -638,6 +638,8 @@ __EOF__ DBAUTH="$DBUSER:$DBPASSWORD@$DBHOST" if [ "$DBTYPE" = 'mysql' ]; then DBCONNSTRING="$DBTYPE+pymysql://$DBAUTH/$DBNAME" + elif [ "$DBTYPE" = 'postgresql' ]; then + DBCONNSTRING="$DBTYPE+psycopg2://$DBAUTH/$DBNAME" else DBCONNSTRING="$DBTYPE://$DBAUTH/$DBNAME" fi