From 36381d41703aef879c87975613deaa345cdfad7d Mon Sep 17 00:00:00 2001 From: lissav Date: Sun, 20 May 2012 18:12:21 +0000 Subject: [PATCH] Add NodeRange XML interface git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12837 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/tabutils.pm | 36 ++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index 2edfbc2a3..91abc85e1 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -60,6 +60,7 @@ sub handled_commands delEntries => "tabutils", getAttribs => "tabutils", setAttribs => "tabutils", + NodeRange => "tabutils", gennr => "tabutils" }; } @@ -170,6 +171,10 @@ sub process_request { return setAttribs($request,$callback); } + elsif ($command eq "NodeRange") + { + return NodeRange($request,$callback); + } else { print "$command not implemented yet\n"; @@ -2312,7 +2317,7 @@ sub getAllEntries # # # -# nodename +#nodename #value1 #. #. @@ -2548,7 +2553,6 @@ sub getAttribs # cluster.net # This is a comment # -# # sub setAttribs { @@ -2569,3 +2573,31 @@ sub setAttribs $tab->setAttribs(\%keyhash,\%attrhash); return; } +# noderange +# Expands the input noderange into a list of nodes. +# +#PCM +#noderange +#compute1-compute2 +# +# +#nodename1 +# . +# . +#nodenamern1 +# +sub NodeRange +{ + my $request = shift; + my $cb = shift; + my $command = $request->{command}->[0]; + my %rsp; + my $node=$request->{node}; + my @nodes = @$node; + foreach my $node (@nodes){ + push @{$rsp{"node"}}, $node; + + } + $cb->(\%rsp); + return; +}