From 9154b2edc9149d31cdd2da86840fd5920aa96440 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 18 Feb 2013 20:22:36 +0000 Subject: [PATCH] improve mgmt into servicenode table git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15201 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatconfig | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index d87572c4e..cb05036bd 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -44,6 +44,17 @@ $::INSTALLDIR = "/install"; # Default TFTP dir location $::TFTPDIR = "/tftpboot"; + my $arraysize=@ARGV; + if ($arraysize ==0) { + my $msg= "No parameters were supplied on the xcatconfig command. Run xcatconfig -h" ; + xCAT::MsgUtils->message("E", $msg); + exit 1; + } + +Getopt::Long::Configure("posix_default"); +Getopt::Long::Configure("no_gnu_compat"); +Getopt::Long::Configure("bundling"); + # parse the options if ( !GetOptions( @@ -67,20 +78,6 @@ if ( exit(1); } -if ( (!$::HELP) - && (!$::FORCE) - && (!$::INITIALINSTALL) - && (!$::UPDATEINSTALL) - && (!$::genSSHRootKeys) - && (!$::genSSHNodeHostKeys) - && (!$::genCredentials) - && (!$::setupMNinDB) - && (!$::initDB) - && (!$::VERSION)) -{ - &usage; - exit(1); -} # display the usage if -h or --help is specified if ($::HELP) @@ -2122,7 +2119,7 @@ sub setupMNinDB my $chtabcmds; # add to the servicenode table $chtabcmds = - "$::XCATROOT/sbin/chtab node=__mgmtnode servicenode.tftpserver=no;"; + "$::XCATROOT/sbin/chtab node=__mgmtnode servicenode.comments=initbyxcatconfig;"; my $outref = xCAT::Utils->runcmd("$chtabcmds", 0); if ($::RUNCMD_RC != 0) {