You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/04/18 14:42:56 UTC

[2/5] incubator-trafficcontrol git commit: fix psql options

fix psql options


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/67051d02
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/67051d02
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/67051d02

Branch: refs/heads/master
Commit: 67051d0232674a3bc64dd1e4e193904e679992c4
Parents: e45681d
Author: Dan Kirkwood <da...@gmail.com>
Authored: Mon Apr 17 12:57:41 2017 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Tue Apr 18 08:42:25 2017 -0600

----------------------------------------------------------------------
 traffic_ops/app/db/admin.pl | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/67051d02/traffic_ops/app/db/admin.pl
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/admin.pl b/traffic_ops/app/db/admin.pl
index baf9b9b..de38394 100755
--- a/traffic_ops/app/db/admin.pl
+++ b/traffic_ops/app/db/admin.pl
@@ -195,7 +195,7 @@ sub load_schema {
 
 sub dropdb {
 	print "Dropping database: $db_name\n";
-	if ( system("dropdb -h $host_ip -p $host_port -U $db_user -e --if-exists $db_name;") != 0 ) {
+	if ( system("dropdb -h $host_ip -p $host_port -U $db_super_user -e --if-exists $db_name;") != 0 ) {
 		die "Can't drop db $db_name\n";
 	}
 }
@@ -206,7 +206,7 @@ sub createdb {
 		print "Database $db_name already exists\n";
 		return;
 	}
-    my $cmd = "createdb -h $host_ip -p $host_port -U $db_super_user --owner $db_user $db_name;";
+	my $cmd = "createdb -h $host_ip -p $host_port -U $db_super_user -e --owner $db_user $db_name;";
 	if ( system($cmd) != 0 ) {
 		die "Can't create db $db_name\n";
 	}
@@ -219,20 +219,20 @@ sub create_user {
 
 	if (!$user_exists) {
 		my $cmd = "CREATE USER $db_user WITH LOGIN ENCRYPTED PASSWORD '$db_password'";
-		if ( system(qq{psql -h $host_ip -p $host_port -U $db_super_user -tAc "$cmd"}) != 0 ) {
+		if ( system(qq{psql -h $host_ip -p $host_port -U $db_super_user -etAc "$cmd"}) != 0 ) {
 			die "Can't create user $db_user\n";
 		}
 	}
 }
 
 sub drop_user {
-	if ( system("dropuser -h $host_ip -p $host_port -i -e $db_user;") != 0 ) {
+	if ( system("dropuser -h $host_ip -p $host_port -U $db_super_user-i -e $db_user;") != 0 ) {
 		die "Can't drop user $db_user\n";
 	}
 }
 
 sub show_users {
-	if ( system("psql -h $host_ip -p $host_port -ec '\\du';") != 0 ) {
+	if ( system("psql -h $host_ip -p $host_port -U $db_super_user -ec '\\du';") != 0 ) {
 		die "Can't show users";
 	}
 }