While investigating defect 3079612, which I could not create. I did find one of our setups for LL was not working on the Client. The /var/lib/db2/sqllib/cfg/db2cli.ini does not exist, which I had instructions to setup for LL. Added a check and must talk to LL

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7742 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2010-10-02 12:25:08 +00:00
parent 3c6a649f16
commit 2c35493c52

View File

@ -1290,34 +1290,35 @@ sub setupODBC
{
my $db2clifile = "/var/lib/db2/sqllib/cfg/db2cli.ini";
my $db2clifilebackup = "/var/lib/db2/sqllib/cfg/db2cli.ini.org";
$cmd = "fgrep -i XCATDB $db2clifile";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) # then xcat entry not there
{
$cmd = "cp $db2clifile $db2clifilebackup ";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
if (-e ( $db2clifile)) {
$cmd = "fgrep -i XCATDB $db2clifile";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) # then xcat entry not there
{
$cmd = "cp $db2clifile $db2clifilebackup ";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
$message = "$cmd failed. Could not setup ODBC.";
xCAT::MsgUtils->message("E", "$message");
exit(1);
}
my $entry = "\n[$instance]\nuid=$instance\npasswd=$passwd";
$cmd = "echo \"$entry\" >> $db2clifile";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
$message = "$cmd failed. Could not setup $db2clifile.";
xCAT::MsgUtils->message("E", "$message");
exit(1);
}
my $entry = "\n[$instance]\nuid=$instance\npasswd=$passwd";
$cmd = "echo \"$entry\" >> $db2clifile";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
$message = "$cmd failed. Could not setup $db2clifile.";
xCAT::MsgUtils->message("E", "$message");
}
}
else
{ # entry already there
$message = "$db2clifile already configured, will not change.";
xCAT::MsgUtils->message("I", "$message");
}
}
else
{ # entry already there
$message = "$db2clifile already configured, will not change.";
xCAT::MsgUtils->message("I", "$message");
}
}
}
}