From d0585fe056b7fb50438873d1af5cb4b44412e37f Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 15 Sep 2014 02:41:51 -0700 Subject: [PATCH 1/5] fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) --- xCAT-server/debian/dirs | 1 + xCAT-server/debian/install | 1 + xCAT-server/debian/rules | 1 + 3 files changed, 3 insertions(+) diff --git a/xCAT-server/debian/dirs b/xCAT-server/debian/dirs index e9bb97e2d..93ede5a69 100644 --- a/xCAT-server/debian/dirs +++ b/xCAT-server/debian/dirs @@ -22,6 +22,7 @@ opt/xcat/share/xcat/ib/netboot/sles opt/xcat/share/xcat/ib/netboot/rh opt/xcat/lib opt/xcat/lib/perl +opt/xcat/lib/perl/Confluent opt/xcat/lib/perl/xCAT opt/xcat/lib/perl/xCAT_plugin opt/xcat/lib/perl/xCAT_schema diff --git a/xCAT-server/debian/install b/xCAT-server/debian/install index 8ecc00e59..6ad9500c6 100644 --- a/xCAT-server/debian/install +++ b/xCAT-server/debian/install @@ -24,6 +24,7 @@ lib/xcat/plugins/* opt/xcat/lib/perl/xCAT_plugin/ lib/xcat/schema/* opt/xcat/lib/perl/xCAT_schema/ lib/xcat/monitoring/* opt/xcat/lib/perl/xCAT_monitoring/ lib/xcat/dsh/Context/* opt/xcat/xdsh/Context +lib/xcat/Confluent/* lib/perl/Confluent/ lib/xcat/shfunctions opt/xcat/lib etc/init.d/xcatd etc/init.d diff --git a/xCAT-server/debian/rules b/xCAT-server/debian/rules index f3a068123..6955f797d 100644 --- a/xCAT-server/debian/rules +++ b/xCAT-server/debian/rules @@ -60,6 +60,7 @@ binary-arch: chmod 644 $(rootdir)/lib/perl/xCAT_monitoring/samples/* chmod 755 $(rootdir)/lib/perl/xCAT_monitoring/pcp chmod 644 $(rootdir)/lib/perl/xCAT_monitoring/pcp/* + chmod 644 $(rootdir)/lib/perl/Confluent/* chmod 644 $(rootdir)/lib/perl/xCAT_schema/* chmod 755 $(rootdir)/lib/perl/xCAT_schema/samples chmod 644 $(rootdir)/lib/perl/xCAT_schema/samples/* From 7f8b48ba408ea76f926b8cebdc8d08acb2f909ff Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 15 Sep 2014 02:50:34 -0700 Subject: [PATCH 2/5] fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) --- xCAT-server/debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/debian/rules b/xCAT-server/debian/rules index 6955f797d..410c07bb6 100644 --- a/xCAT-server/debian/rules +++ b/xCAT-server/debian/rules @@ -60,7 +60,7 @@ binary-arch: chmod 644 $(rootdir)/lib/perl/xCAT_monitoring/samples/* chmod 755 $(rootdir)/lib/perl/xCAT_monitoring/pcp chmod 644 $(rootdir)/lib/perl/xCAT_monitoring/pcp/* - chmod 644 $(rootdir)/lib/perl/Confluent/* + chmod 644 $(rootdir)/lib/perl/Confluent/* chmod 644 $(rootdir)/lib/perl/xCAT_schema/* chmod 755 $(rootdir)/lib/perl/xCAT_schema/samples chmod 644 $(rootdir)/lib/perl/xCAT_schema/samples/* From 83ed138db24a44533a545cd62ecf8e1ce80cc8f3 Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 15 Sep 2014 03:04:57 -0700 Subject: [PATCH 3/5] fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) --- xCAT-server/debian/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/debian/install b/xCAT-server/debian/install index 6ad9500c6..37c168c20 100644 --- a/xCAT-server/debian/install +++ b/xCAT-server/debian/install @@ -24,7 +24,7 @@ lib/xcat/plugins/* opt/xcat/lib/perl/xCAT_plugin/ lib/xcat/schema/* opt/xcat/lib/perl/xCAT_schema/ lib/xcat/monitoring/* opt/xcat/lib/perl/xCAT_monitoring/ lib/xcat/dsh/Context/* opt/xcat/xdsh/Context -lib/xcat/Confluent/* lib/perl/Confluent/ +lib/xcat/Confluent/* opt/xcat/lib/perl/Confluent/ lib/xcat/shfunctions opt/xcat/lib etc/init.d/xcatd etc/init.d From fe890637c95d9da6c048595a5f67f5bee30f042a Mon Sep 17 00:00:00 2001 From: qyin Date: Mon, 15 Sep 2014 17:32:28 +0800 Subject: [PATCH 4/5] fix issue 241844 The added os packages are not installed when reinstall nodes. --- xCAT-server/lib/xcat/plugins/profilednodes.pm | 89 ++++++++++++++----- 1 file changed, 67 insertions(+), 22 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index 09f72adce..2f0cc335f 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -1302,26 +1302,50 @@ Usage: my $nodelist = $request->{node}; my $hostname = $nodelist->[0]; - # Validate MAC address - my $recordsref = xCAT::ProfiledNodeUtils->get_allnode_singleattrib_hash('mac', 'mac'); - %allmacs = %$recordsref; - foreach (keys %allmacs){ - my @hostentries = split(/\|/, $_); - foreach my $hostandmac ( @hostentries){ - my ($macstr, $machostname) = split("!", $hostandmac); - $allmacs{$macstr} = 0; + if("__NOMAC__" eq $args_dict{"mac"}) { + # Validate if node is bind on a switch + my $switch_table = xCAT::Table->new("switch"); + my @item = $switch_table->getAttribs({'node' => $hostname}, 'switch', 'port'); + my $item_num = @item; + my $switch_valid = 0; + unless($item[0]) + { + setrsp_errormsg("Failed to replace node <$hostname>. Switch information cannot be retrieved. Ensure that the switch is configured correctly."); + return; + } else { + foreach my $switch_item (@item){ + if($switch_item->{'switch'} && $switch_item->{'port'}){ + $switch_valid = 1; + } + } + } + unless ($switch_valid) + { + setrsp_errormsg("Failed to replace node <$hostname>. Switch information cannot be retrieved. Ensure that the switch is configured correctly."); + return; + } + } else { + #Validate MAC address + my $recordsref = xCAT::ProfiledNodeUtils->get_allnode_singleattrib_hash('mac', 'mac'); + %allmacs = %$recordsref; + foreach (keys %allmacs){ + my @hostentries = split(/\|/, $_); + foreach my $hostandmac ( @hostentries){ + my ($macstr, $machostname) = split("!", $hostandmac); + $allmacs{$macstr} = 0; + } + } + %allmacsupper = (); + foreach (keys %allmacs){ + $allmacsupper{uc($_)} = 0; + } + if (exists $allmacsupper{uc($args_dict{"mac"})}){ + setrsp_errormsg("The specified MAC address $args_dict{'mac'} already exists. You must use a different MAC address."); + return; + } elsif(! xCAT::NetworkUtils->isValidMAC($args_dict{'mac'})) { + setrsp_errormsg("The specified MAC address $args_dict{'mac'} is invalid. You must use a valid MAC address."); + return; } - } - %allmacsupper = (); - foreach (keys %allmacs){ - $allmacsupper{uc($_)} = 0; - } - if (exists $allmacsupper{uc($args_dict{"mac"})}){ - setrsp_errormsg("The specified MAC address $args_dict{'mac'} already exists. You must use a different MAC address."); - return; - } elsif(! xCAT::NetworkUtils->isValidMAC($args_dict{'mac'})){ - setrsp_errormsg("The specified MAC address $args_dict{'mac'} is invalid. You must use a valid MAC address."); - return; } # re-create the chain record as updating mac may means for replacing a new brand hardware... @@ -1341,9 +1365,19 @@ Usage: # Update database records. setrsp_progress("Updating database..."); # MAC table - my $mactab = xCAT::Table->new('mac',-create=>1); - $mactab->setNodeAttribs($hostname, {mac=>$args_dict{'mac'}}); - $mactab->close(); + if("__NOMAC__" eq $args_dict{"mac"}) + { + my $mactab = xCAT::Table->new('mac',-create=>1); + my %keyhash; + $keyhash{'node'} = $hostname; + $mactab->delEntries(\%keyhash); + $mactab->commit(); + $mactab->close(); + } else { + my $mactab = xCAT::Table->new('mac',-create=>1); + $mactab->setNodeAttribs($hostname, {mac=>$args_dict{'mac'}}); + $mactab->close(); + } # DB update: chain table. my $chaintab = xCAT::Table->new('chain', -create=>1); @@ -1370,6 +1404,17 @@ Usage: setrsp_progress("Warning: failed to call kit commands."); } + if("__NOMAC__" eq $args_dict{"mac"}) + { + setrsp_progress("Updating DHCP entries"); + $retref = xCAT::Utils->runxcmd({command=>["makedhcp"], node=>[$hostname], arg=>['-d']}, $request_command, 0, 2); + $retref = {}; + $retstrref = parse_runxcmd_ret($retref); + if ($::RUNCMD_RC != 0){ + setrsp_progress("Warning: failed to call kit commands."); + } + } + setrsp_progress("Re-creating nodes..."); $retref = xCAT::Utils->runxcmd({command=>["kitnodeadd"], node=>[$hostname], macflag=>[1]}, $request_command, 0, 2); $retstrref = parse_runxcmd_ret($retref); From f2901b06d0820d42ff08ba4b1a1a2be8288115be Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 15 Sep 2014 07:02:11 -0400 Subject: [PATCH 5/5] fix description --- perl-xCAT/xCAT/Schema.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 554be4b36..acadf67ca 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -946,7 +946,7 @@ site => { " nodestatus: If set to 'n', the nodelist.status column will not be updated during\n". " the node deployment, node discovery and power operations. The default is to update.\n\n". " skiptables: Comma separated list of tables to be skipped by dumpxCATdb\n\n". - " skipvalidatelog: If set, then getcredential and getpostscript call will not be logged.\n\n". + " skipvalidatelog: If set to 1, then getcredentials and getpostscripts calls will not be logged in syslog.\n\n". " -------------\n". "DHCP ATTRIBUTES\n". " -------------\n".