support adding/removing nichostnames as well as the given noderange

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16531 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
sjing 2013-06-04 08:20:52 +00:00
parent 8945c5ca33
commit 726c05134c
2 changed files with 16 additions and 7 deletions

View File

@ -302,7 +302,11 @@ sub process_request {
my $domain;
if ($request->{node}) { #leverage makehosts code to flesh out the options
require xCAT_plugin::hosts;
xCAT_plugin::hosts::add_hosts_content(nodelist=>$request->{node},callback=>$callback,hostsref=>\@contents);
my @content1;
my @content2;
xCAT_plugin::hosts::add_hosts_content(nodelist=>$request->{node},callback=>$callback,hostsref=>\@content1);
xCAT_plugin::hosts::donics(nodes=>$request->{node},callback=>$callback,hostsref=>\@content2);
@contents = (@content1, @content2);
} else {
#legacy behavior, read from /etc/hosts
my $hostsfile;

View File

@ -414,7 +414,7 @@ sub process_request
} # end else
# do the other node nics - if any
&donics($req->{node}, $callback, $DELNODE);
&donics(nodes=>$req->{node}, callback=>$callback, delnode=>$DELNODE);
}
else
{
@ -452,7 +452,7 @@ sub process_request
}
# also do nics table
&donics(\@allnodes, $callback, $DELNODE);
&donics(nodes=>\@allnodes, callback=>$callback, delnode=>$DELNODE);
}
writeout();
@ -490,7 +490,7 @@ sub writeout
Globals:
Example:
my $rc = &donics(\@nodes, $callback, $DELNODE);
my $rc = &donics(nodes=>\@allnodes, callback=>$callback, delnode=>$DELNODE);
Comments:
none
@ -499,9 +499,10 @@ sub writeout
#-------------------------------------------------------------------------------
sub donics
{
my $nodes = shift;
my $callback = shift;
my $delnode = shift;
my %args = @_;
my $nodes = $args{nodes};
my $callback = $args{callback};
my $delnode = $args{delnode};
my @nodelist = @{$nodes};
@ -718,6 +719,10 @@ sub donics
} # end for each nic
} # end for each node
if ($args{hostsref}) {
@{$args{hostsref}} = @hosts;
}
$nettab->close;
$nicstab->close;