diff --git a/xCAT-client/pods/man8/makeconservercf.8.pod b/xCAT-client/pods/man8/makeconservercf.8.pod index 3c40a189f..2cd750dcd 100644 --- a/xCAT-client/pods/man8/makeconservercf.8.pod +++ b/xCAT-client/pods/man8/makeconservercf.8.pod @@ -4,7 +4,7 @@ B - creates the conserver configuration file from info in the x =head1 SYNOPSIS -B [B<-l|--local>] [I] +B [B<-l|--local|-d|--delete>] [I] B [B<-h|--help|-v|--version>] @@ -26,6 +26,10 @@ all relevant management/service nodes. If -l is specified, it will only create =over 10 +=item B<-d|--delete> + +Delete rather than add or refresh the nodes specified as a noderange. + =item B<-l|--local> Only run B locally and create the local /etc/conserver.cf. The default is to also diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 949d1ac4d..80b5ca1d8 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -13,13 +13,14 @@ my @cservers = qw(mrv cyclades); my %termservers; #list of noted termservers my $usage_string= -" makeconservercf noderange +" makeconservercf [-d|--delete] noderange makeconservercf [-l|--local] makeconservercf -h|--help makeconservercf -v|--version -l|--local The conserver gets set up only on the local host. The default goes down to all the conservers on - the server nodes and set them up. + the server nodes and set them up + -d|--delete Conserver has the relevant entries for the given noderange removed immediately from configuration -h|--help Display this usage statement. -v|--version Display the version number."; @@ -207,6 +208,16 @@ sub makeconservercf { my $req = shift; %termservers = (); #clear hash of existing entries my $cb = shift; + my $extrargs = $req->{arg}; + my @exargs=($req->{arg}); + if (ref($extrargs)) { + @exargs=@$extrargs; + } + @ARGV=@exargs; + $Getopt::Long::ignorecase=0; + #$Getopt::Long::pass_through=1; + my $delmode; + GetOptions('d|delete' => \$delmode); my $nodes = $req->{node}; my $svboot=0; if (exists($req->{svboot})) { $svboot=1;} @@ -279,7 +290,7 @@ sub makeconservercf { dotsent($_,\@filecontent); $termservers{$_->{termserver}}=1; #prevent needless cycles being burned } - donodeent($_,\@filecontent); + donodeent($_,\@filecontent,$delmode); } } } @@ -369,6 +380,7 @@ sub donodeent { my $cfgent = shift; my $node = $cfgent->{node}; my $content = shift; + my $delmode = shift; my $idx=0; my $toidx=-1; my $skip = 0; @@ -391,6 +403,9 @@ sub donodeent { } $skip = $skipnext; } + if ($delmode) { + return; + } push @$content,"#xCAT BEGIN $node CONS\n"; push @$content,"console $node {\n"; #if ($cfgent->{cons}