trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neu...@apache.org
Subject [04/10] incubator-trafficcontrol git commit: fixed issue where the wrong conf file was being read
Date Fri, 12 May 2017 16:11:32 GMT
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/77a99c61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/77a99c61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/77a99c61

Branch: refs/heads/master
Commit: 77a99c61de8d4a8f49b180900830df16064d3594
Parents: 67c796d
Author: Dewayne Richardson <dewrich@apache.org>
Authored: Fri May 12 08:53:30 2017 -0600
Committer: David Neuman <david.neuman64@gmail.com>
Committed: Fri May 12 09:54:32 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/77a99c61/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" );
     }


Mime
View raw message