From ec4ce73d5be41c86da62d0b1ff936526fb7d65fd Mon Sep 17 00:00:00 2001 From: wangxiaopeng Date: Wed, 6 Jan 2016 06:03:23 -0500 Subject: [PATCH] Issue 569: check the value of site.xcatsslversion before setting default value --- xCAT-server/sbin/xcatconfig | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index f7a37c903..a2188ef76 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -1426,16 +1426,17 @@ sub initDB } } - # add default value to site.xcatsslversion - $cmds = "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=TLSv1;"; - $outref = xCAT::Utils->runcmd("$cmds", 0); - if ($::RUNCMD_RC != 0) - { - xCAT::MsgUtils->message('E',"Could not add default value for site.xcatsslversion."); + # Set default value for site.xcatsslversion when update xcat + $cmds = "XCATBYPASS=Y $::XCATROOT/sbin/tabdump site 2>/dev/null |grep xcatsslversion"; + xCAT::Utils->runcmd("$cmds", -1); + if ($::RUNCMD_RC != 0) { + # if site.xcatsslversion was not set, then set the default value TLSv1 + $cmds = "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=TLSv1;"; + xCAT::Utils->runcmd("$cmds", 0); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->message('E',"Could not add default value for site.xcatsslversion."); + } } - - - } # remove xcatserver,xcatclient # from the postscripts. They are now called by servicenode