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/05/12 15:01:15 UTC

[3/4] incubator-trafficcontrol git commit: fixed issue where the wrong conf file was being read

fixed issue where the wrong conf file was being read


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

Branch: refs/heads/master
Commit: 5ef3d40f2edf01b0345f0e7e31e7627b7f8278f9
Parents: 0ecd276
Author: Dewayne Richardson <de...@apache.org>
Authored: Fri May 12 08:53:30 2017 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Fri May 12 08:59:19 2017 -0600

----------------------------------------------------------------------
 traffic_ops/install/lib/Database.pm | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/5ef3d40f/traffic_ops/install/lib/Database.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/install/lib/Database.pm b/traffic_ops/install/lib/Database.pm
index 9dbbc31..57f6c90 100644
--- a/traffic_ops/install/lib/Database.pm
+++ b/traffic_ops/install/lib/Database.pm
@@ -28,19 +28,20 @@ sub connect {
     my $databaseConfFile = shift;
     my $todbconf = shift;
 
-    my $dbconf = InstallUtils::readJson($databaseConfFile);
+    my $conf = InstallUtils::readJson($databaseConfFile);
 
     # Check if the Postgres db is used and set the admin database to be "postgres"
-    my $dbName = $dbconf->{type};
-    if ( $dbconf->{type} eq "Pg" ) {
+    my $dbName = $conf->{type};
+    if ( $conf->{type} eq "Pg" ) {
         $dbName = "traffic_ops";
     }
 
-    $ENV{PGUSER}     = $todbconf->{"pgUser"};
-    $ENV{PGPASSWORD} = $todbconf->{"pgPassword"};
+	$ENV{PGUSER}     = $conf->{"user"};
+	$ENV{PGPASSWORD} = $conf->{"password"};
 
-    my $dsn = sprintf( "DBI:%s:db=%s;host=%s;port=%d", $dbconf->{type}, $dbName, $dbconf->{hostname}, $dbconf->{port} );
-    my $dbh = DBI->connect( $dsn, $todbconf->{"pgUser"}, $todbconf->{"pgPassword"} );
+    my $dsn = sprintf( "DBI:%s:db=%s;host=%s;port=%d", $conf->{type}, $dbName, $conf->{hostname}, $conf->{port} );
+    InstallUtils::logger( "dsn: " . $dsn, "info" );
+    my $dbh = DBI->connect( $dsn, $todbconf->{"user"}, $todbconf->{"password"} );
     if ($dbh) {
         InstallUtils::logger( "Database connection succeeded", "info" );
     }