From 87d39483e6712a7fe959193b8a9f8aaf9a536cce Mon Sep 17 00:00:00 2001 From: mellor Date: Wed, 5 Jan 2011 19:19:06 +0000 Subject: [PATCH] rollupdate defect 3147708 - check for updateall_nodecount if updateall=yes git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8555 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/rollupdate.pm | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/rollupdate.pm b/xCAT-server/lib/xcat/plugins/rollupdate.pm index 4bde5add8..926e84f05 100644 --- a/xCAT-server/lib/xcat/plugins/rollupdate.pm +++ b/xCAT-server/lib/xcat/plugins/rollupdate.pm @@ -457,9 +457,14 @@ sub rollupdate { # Build updategroup nodelists # my %updategroup; + + # Check for updateall and required stanzas + $::updateall=0; + $::updateall_nodecount=1; if ( defined($::FILEATTRS{updateall}[0]) && ( ($::FILEATTRS{updateall}[0] eq 'yes') || ($::FILEATTRS{updateall}[0] eq 'y' ) ) ) { + $::updateall=1; if ( defined($::FILEATTRS{updateall_nodes}[0])){ my $ugname = "UPDATEALL".time(); my $ugval = $::FILEATTRS{updateall_nodes}[0]; @@ -471,7 +476,17 @@ sub rollupdate { xCAT::MsgUtils->message( "E", $rsp, $::CALLBACK ); return 1; } + if ( defined($::FILEATTRS{updateall_nodecount}[0]) ) { + $::updateall_nodecount=$::FILEATTRS{updateall_nodecount}[0]; + } else { + my $rsp; + push @{ $rsp->{data} }, +"Error processing stanza input: updateall=yes but no updateall_nodecount specified. "; + xCAT::MsgUtils->message( "E", $rsp, $::CALLBACK ); + return 1; + } } else { + # Standard update (NOT updateall) foreach my $ugline ( @{ $::FILEATTRS{'updategroup'} } ) { my ( $ugname, $ugval ) = split( /\(/, $ugline ); $ugval =~ s/\)$//; # remove trailing ')' @@ -590,17 +605,6 @@ sub ll_jobs { close (RULOG); } - $::updateall=0; - $::updateall_nodecount=1; - if ( defined($::FILEATTRS{updateall}[0]) && - ( ($::FILEATTRS{updateall}[0] eq 'yes') || - ($::FILEATTRS{updateall}[0] eq 'y' ) ) ) { - $::updateall=1; - if ( defined($::FILEATTRS{updateall_nodecount}[0]) ) { - $::updateall_nodecount=$::FILEATTRS{updateall_nodecount}[0]; - } - } - # Create LL floating resources for mutual exclusion support # and max_updates