Add setup of postgresql

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16361 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2013-05-20 11:01:20 +00:00
parent dd438f5cfa
commit ee7d43cc61

View File

@ -64,12 +64,18 @@ else
`logger -t xcat -p local4.info $msg`;
&setupmysqlodbc;
}
else
{
else {
if ($dbname eq "PG")
{
$msg = "odbcsetup:Setting up ODBC for PostgreSQL";
`logger -t xcat -p local4.info $msg`;
&setupPGodbc;
} else {
$msg =
"odbcsetup:cfgloc file does not contain MySQL or DB2, will not setup ODBC.";
"odbcsetup:cfgloc file does not contain MySQL, DB2 or PG, will not setup ODBC.";
`logger -t xcat -p local4.err $msg`;
exit 1;
}
}
}
@ -140,6 +146,30 @@ sub setupmysqlodbc
}
#####################################################
#
# setupPGodbc
# runs the pgsqlsetup script and sets up the ODBC on the Client
#
#####################################################
sub setupPGodbc
{
my $msg;
my $rc = 0;
my $cmd;
$cmd = "$::XCATROOT/bin/pgsqlsetup -o";
$msg = "odbcsetup: Running Client ODBC setup. \"$cmd\"\n";
`logger -t xcat -p local4.info $msg`;
$rc = &runcmd($cmd);
$msg = "odbcsetup: Client ODBC setup finished.\n";
`logger -t xcat -p local4.info $msg`;
return $rc;
}
#
# run the command
#