From 0d0cf639e1596c8132ddb5384afb2045a244a074 Mon Sep 17 00:00:00 2001 From: vallard Date: Tue, 5 Jan 2010 05:12:38 +0000 Subject: [PATCH] added gennr for using nodels without database git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4888 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/tabutils.pm | 25 +++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index a932df26f..4b269f859 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -49,7 +49,8 @@ sub handled_commands chtype => "tabutils", # not implemented yet nr => "tabutils", # not implemented yet rnoderange => "tabutils", # not implemented yet - tabgrep => "tabutils" + tabgrep => "tabutils", + gennr => "tabutils" }; } @@ -109,6 +110,10 @@ sub process_request { return nodech($nodes, $args, $callback, "groupch"); } + elsif ($command eq "gennr") + { + return gennr($nodes, $args, $callback); + } elsif ($command eq "nodech" or $command eq "chnode") { return nodech($nodes, $args, $callback, 0); @@ -1015,6 +1020,24 @@ sub nodech } } +# gennr linked to xcatclientnnr and is used to generate a list of nodes +# external to the database. +sub gennr { + my $nodes = shift; + my $args = shift; + my $callback = shift; + @ARGV = @{$args}; + my $nr = shift @ARGV; + $nodes = [noderange($nr, 0)]; + my %rsp; # for output. + foreach (@$nodes){ + #print $_ . "\n"; + push @{$rsp{data}}, $_; + + } + $callback->(\%rsp); +} + sub tabgrep { my $node = shift;