fix logic on call to genSSHNodeHostKey, should only be called with -u -i -f -s flags

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13312 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2012-07-18 11:35:32 +00:00
parent edc06a1908
commit 731b3d3bf9

View File

@ -184,14 +184,16 @@ chomp $::arch;
chomp $::root;
# some Linux-only config
#
# Generate ssh host keys for the nodes
#
#
if (xCAT::Utils->isMN()) {
&genSSHNodeHostKey;
if ($::FORCE || $::genSSHNodeHostKeys || $::INITIALINSTALL || $::UPDATEINSTALL )
{
&genSSHNodeHostKey;
}
}
#
# gen root's ssh keys, if needed and copy to appropriate directories to
@ -642,13 +644,11 @@ sub genSSHNodeHostKey
my $hostkey = "$::INSTALLDIR/postscripts/hostkeys/ssh_host_rsa_key";
my $hostkey2 = "/etc/xcat/hostkeys/ssh_host_rsa_key";
if ( ((!-r $hostkey) && (!-r $hostkey2))
|| $::FORCE
|| $::genSSHNodeHostKeys)
if ((!-r $hostkey) && (!-r $hostkey2)) # if they do not exist
{
# create directories /etc/xcat/hostkeys and /install/postscripts/hostkeys
if (!-d "$::INSTALLDIR/postscripts/hostkeys") # directory for public keys
#create directories /etc/xcat/hostkeys and /install/postscripts/hostkeys
if (!-d "$::INSTALLDIR/postscripts/hostkeys") # dir for public keys
{
my $cmd = "/bin/mkdir -m 755 -p $::INSTALLDIR/postscripts/hostkeys";
my $outref = xCAT::Utils->runcmd("$cmd", 0);