From 204737f8263fe1afa5ac455dbf66540acecccca5 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 17 Apr 2014 21:23:27 -0500 Subject: [PATCH 1/5] fix for bug 4074: different ifconfig -a output on RHEL7 --- perl-xCAT/xCAT/NetworkUtils.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index c76cef6ff..cd780d9af 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -1621,8 +1621,10 @@ sub gethost_ips else { my ($inet, $addr1, $Bcast, $Mask) = split(" ", $addr); - @ip = split(":", $addr1); - push @ipaddress, $ip[1]; + #@ip = split(":", $addr1); + #push @ipaddress, $ip[1]; + $addr1 =~ s/.*://; + push @ipaddress, $addr1; } } else From 6bb5a53c37c0170f418d77422305f4aeebea463b Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 17 Apr 2014 10:17:21 -0400 Subject: [PATCH 2/5] 4072 --- xCAT-server/lib/xcat/plugins/networks.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 256a93f16..c21c7f852 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -26,8 +26,7 @@ sub preprocess_request my @requests = ({%$req}); #first element is local instance $::args = $req->{arg}; - - if (defined(@{$::args})) { + if ( defined ($::args) && @{$::args} ) { @ARGV = @{$::args}; } @@ -88,7 +87,7 @@ sub process_request $::args = $request->{arg}; - if (defined(@{$::args})) { + if ( defined ($::args) && @{$::args} ) { @ARGV = @{$::args}; } From dc4a67cfe3aa4dfe16da3173ddc0ae1567368ca7 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 17 Apr 2014 22:55:20 -0500 Subject: [PATCH 3/5] fix for bug 4084: AIX rpm spec does not allow %if inside %ifos --- xCAT-server/xCAT-server.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index de05d73ac..8f01cf83b 100755 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -27,10 +27,17 @@ AutoReqProv: no BuildArch: noarch Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser Obsoletes: atftp-xcat +%endif + +# The aix rpm cmd forces us to do this outside of ifos type stmts %if %notpcm +%ifos linux +%ifnarch s390x +# PCM does not use or ship conserver Requires: grub2-xcat %endif %endif +%endif %if %fsm # nothing needed here From c79270ac4bb7bb352c7e6f70b04f17dfbfa41b99 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 17 Apr 2014 23:00:21 -0500 Subject: [PATCH 4/5] a typo in the comment --- xCAT-server/xCAT-server.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 xCAT-server/xCAT-server.spec diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec old mode 100755 new mode 100644 index 8f01cf83b..c447d9963 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -33,7 +33,7 @@ Obsoletes: atftp-xcat %if %notpcm %ifos linux %ifnarch s390x -# PCM does not use or ship conserver +# PCM does not use or ship grub2-xcat Requires: grub2-xcat %endif %endif From b0daa952095343332737086508b06b6ae1733d17 Mon Sep 17 00:00:00 2001 From: Lei Ai Date: Fri, 18 Apr 2014 15:45:44 +0800 Subject: [PATCH 5/5] Merge fix from branch 2.8: create non-blocking call for nodechprofile --- xCAT-server/lib/xcat/plugins/profilednodes.pm | 78 +++++++++++-------- 1 file changed, 47 insertions(+), 31 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index 3e47c5bb0..1dbb7f141 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -54,6 +54,7 @@ my $command; my $args; # Put arguments in a hash. my %args_dict; +my %general_arg; #------------------------------------------------------- @@ -100,6 +101,8 @@ sub process_request { $command = $request->{command}->[0]; $args = $request->{arg}; + my $gereral_arg = get_general_args(); + # There is no need to acquire lock for command nodediscoverstatus, nodediscoverls and noderegenips. if ($command eq "nodediscoverstatus"){ nodediscoverstatus(); @@ -112,7 +115,11 @@ sub process_request { return; } - my $lock = xCAT::Utils->acquire_lock("nodemgmt", 1); + my $non_block = 1; + if ( $general_arg{'blockmode'} == 1) { + $non_block = 0; + } + my $lock = xCAT::Utils->acquire_lock("nodemgmt", $non_block); if (! $lock){ setrsp_errormsg("Cannot acquire lock, another process is already running."); return; @@ -131,7 +138,7 @@ sub process_request { ); setrsp_errormsg("Cannot $errormsg_dict{$command} while node discovery is running."); - xCAT::Utils->release_lock($lock, 1); + xCAT::Utils->release_lock($lock, $non_block); return; } } @@ -156,7 +163,32 @@ sub process_request { nodechmac(); } - xCAT::Utils->release_lock($lock, 1); + xCAT::Utils->release_lock($lock, $non_block); +} + +sub get_general_args +{ + my ($help, $ver, $blockmode); + %general_arg = (); + @ARGV = (); + if($args) { + @ARGV = @$args; + } + GetOptions( + 'h|help' => \$help, + 'v|version' => \$ver, + 'b|block' => \$blockmode, + ); + + if($help){ + $general_arg{'help'} = 1; + } + if($ver){ + $general_arg{'version'} = 1; + } + if ($blockmode) { + $general_arg{'blockmode'} = 1; + } } #------------------------------------------------------- @@ -202,37 +234,21 @@ sub validate_args{ my $enabledparamsref = shift; my $mandatoryparamsref = shift; - # The -h -v are handled by seqdiscovery.pm - # -t -u -l only works for nodediscoverls, and them only handled by seqdiscovery.pm - my ($help, $ver, $type, $uuid, $long); + if ($general_arg{'help'} == 1){ + my %process_help_commands = ( + 'nodediscoverstart' => 1, + 'nodediscoverstop' => 1, + 'nodediscoverls' => 1, + 'nodediscoverstatus' => 1, + ); - @ARGV = (); - if($args) { - @ARGV = @$args; - } - GetOptions( - 'h|help' => \$help, - 'v|version' => \$ver, - 't=s' => \$type, - 'u=s' => \$uuid, - 'l' => \$long, - ); - - if($help){ - # just return to make sequential discovery to handle it - return 0; + # do not process help message for these noddiscover* commands, cover them in seqdiscovery.pm + unless ($process_help_commands{$command} == 1) { + setrsp_infostr($helpmsg); + return 0; + } } - if($ver){ - # just return to make sequential discovery to handle it - return 0; - } - - if ($type || $uuid || $long) { - # these args for general discovery, return directly - return 0; - } - my $parseret = parse_args(); if ($parseret){ setrsp_errormsg($parseret);