Fixed noderange and the man page for it
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@429 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
e6b8dfd8c1
commit
4c32555f70
@ -11,7 +11,7 @@ our @EXPORT = qw(noderange nodesmissed);
|
||||
|
||||
my $missingnodes=[];
|
||||
my $nodelist; #=xCAT::Table->new('nodelist',-create =>1);
|
||||
my $nodeprefix = "node";
|
||||
#my $nodeprefix = "node";
|
||||
|
||||
|
||||
sub subnodes (\@@) {
|
||||
@ -30,23 +30,26 @@ sub expandatom {
|
||||
my $atom = shift;
|
||||
my $verify = (scalar(@_) == 1 ? shift : 1);
|
||||
my @nodes= ();
|
||||
#TODO: these env vars need to get passed by the client to xcatd
|
||||
my $nprefix=(defined ($ENV{'XCAT_NODE_PREFIX'}) ? $ENV{'XCAT_NODE_PREFIX'} : 'node');
|
||||
my $nsuffix=(defined ($ENV{'XCAT_NODE_SUFFIX'}) ? $ENV{'XCAT_NODE_PREFIX'} : '');
|
||||
if ($nodelist->getAttribs({node=>$atom},'node')) {
|
||||
#The atom is a plain old nodename
|
||||
my $nsuffix=(defined ($ENV{'XCAT_NODE_SUFFIX'}) ? $ENV{'XCAT_NODE_SUFFIX'} : '');
|
||||
if ($nodelist->getAttribs({node=>$atom},'node')) { #The atom is a plain old nodename
|
||||
return ($atom);
|
||||
}
|
||||
if ($atom =~ /^\(.*\)$/) {
|
||||
if ($atom =~ /^\(.*\)$/) { # handle parentheses by recursively calling noderange()
|
||||
$atom =~ s/^\((.*)\)$/$1/;
|
||||
return noderange($atom);
|
||||
}
|
||||
|
||||
# Try to match groups?
|
||||
foreach($nodelist->getAllAttribsWhere("groups like '%".$atom."%'",'node','groups')) {
|
||||
my @groups=split(/,/,$_->{groups}); #The where clause doesn't guarantee the atom is a full group name, only that it could be
|
||||
if (grep { $_ eq "$atom" } @groups ) {
|
||||
push @nodes,$_->{node};
|
||||
}
|
||||
}
|
||||
if ($atom =~ m/^[0-9]+\z/) {
|
||||
|
||||
if ($atom =~ m/^[0-9]+\z/) { # if only numbers, then add the prefix
|
||||
my $nodename=$nprefix.$atom.$nsuffix;
|
||||
return expandatom($nodename,$verify);
|
||||
}
|
||||
@ -54,7 +57,22 @@ sub expandatom {
|
||||
if ($nodelen > 0) {
|
||||
return @nodes;
|
||||
}
|
||||
if ($atom =~ m/(.*)\[(.*)\](.*)/) { #bracket range
|
||||
|
||||
if ($atom =~ m/^\//) { # A regular expression
|
||||
unless ($verify) { # If not in verify mode, regex makes zero possible sense
|
||||
return ($atom);
|
||||
}
|
||||
#TODO: check against all groups
|
||||
$atom = substr($atom,1);
|
||||
foreach ($nodelist->getAllAttribs('node')) {
|
||||
if ($_->{node} =~ m/^${atom}$/) {
|
||||
push(@nodes,$_->{node});
|
||||
}
|
||||
}
|
||||
return(@nodes);
|
||||
}
|
||||
|
||||
if ($atom =~ m/(.*)\[(.*)\](.*)/) { # square bracket range
|
||||
#for the time being, we are only going to consider one [] per atom
|
||||
#xcat 1.2 does no better
|
||||
my @subelems = split(/([\,\-\:])/,$2);
|
||||
@ -69,7 +87,8 @@ sub expandatom {
|
||||
}
|
||||
return @nodes;
|
||||
}
|
||||
if ($atom =~ m/\+/) {#process + operator
|
||||
|
||||
if ($atom =~ m/\+/) { # process the + operator
|
||||
$atom =~ m/^([^0-9]*)([0-9]+)([^\+]*)\+([0-9]+)/;
|
||||
my $pref=$1;
|
||||
my $startnum=$2;
|
||||
@ -89,7 +108,8 @@ sub expandatom {
|
||||
}
|
||||
return (@nodes);
|
||||
}
|
||||
if ($atom =~ m/[-:]/) {#process - range operator
|
||||
|
||||
if ($atom =~ m/[-:]/) { # process the minus range operator
|
||||
my $left;
|
||||
my $right;
|
||||
if ($atom =~ m/:/) {
|
||||
@ -99,7 +119,7 @@ sub expandatom {
|
||||
if (($count % 2)==0) { #can't understand even numbers of - in range context
|
||||
if ($verify) {
|
||||
push @$missingnodes,$atom;
|
||||
return ();
|
||||
return ();
|
||||
} else { #but we might not really be in range context, if noverify
|
||||
return ($atom);
|
||||
}
|
||||
@ -122,7 +142,7 @@ sub expandatom {
|
||||
return ($atom);
|
||||
}
|
||||
}
|
||||
my $prefix = "";
|
||||
my $prefix = "";
|
||||
my $suffix = "";
|
||||
foreach (0..$#leftarr) {
|
||||
my $idx = $_;
|
||||
@ -131,7 +151,7 @@ sub expandatom {
|
||||
my $prefix = join('',@leftarr[0..($idx-1)]); #Make a prefix of the pre-validated parts
|
||||
my $luffix; #However, the remainder must still be validated to be the same
|
||||
my $ruffix;
|
||||
if ($idx eq $#leftarr) {
|
||||
if ($idx eq $#leftarr) {
|
||||
$luffix="";
|
||||
$ruffix="";
|
||||
} else {
|
||||
@ -159,7 +179,7 @@ sub expandatom {
|
||||
} else {
|
||||
return ($atom);
|
||||
}
|
||||
}
|
||||
}
|
||||
$prefix .= $leftarr[$idx]; #If here, it means that the pieces were the same, but more to come
|
||||
}
|
||||
#I cannot conceive how the code could possibly be here, but whatever it is, it must be questionable
|
||||
@ -169,22 +189,8 @@ sub expandatom {
|
||||
} else { #Not in verify mode, just have to guess it's meant to be a nodename
|
||||
return ($atom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($atom =~ m/^\//) { #A regex
|
||||
unless ($verify) { #If not in verify mode, regex makes zero possible sense
|
||||
return ($atom);
|
||||
}
|
||||
#TODO: check against all groups
|
||||
$atom = substr($atom,1);
|
||||
foreach ($nodelist->getAllAttribs('node')) {
|
||||
if ($_->{node} =~ m/^${atom}$/) {
|
||||
push(@nodes,$_->{node});
|
||||
}
|
||||
}
|
||||
return(@nodes);
|
||||
}
|
||||
}
|
||||
|
||||
push @$missingnodes,$atom;
|
||||
if ($verify) {
|
||||
return ();
|
||||
@ -205,14 +211,15 @@ sub noderange {
|
||||
my %delnodes = ();
|
||||
my $op = ",";
|
||||
#my @elems = split(/(,(?![^[]*?])|@)/,$range); #, or @ but ignore , within []
|
||||
my @elems = split(/(,(?![^[]*?])(?![^\(]*?\))|@(?![^\(]*?\)))/,$range); #, or @ but ignore , within []
|
||||
my @elems = split(/(,(?![^[]*?])(?![^\(]*?\))|@(?![^\(]*?\)))/,$range); # comma or @ but ignore comma within []
|
||||
|
||||
while (my $atom = shift @elems) {
|
||||
if ($atom =~ /^-/) {
|
||||
if ($atom =~ /^-/) { # if this is an exclusion, strip off the minus, but remember it
|
||||
$atom = substr($atom,1);
|
||||
$op = $op."-";
|
||||
}
|
||||
if ($atom =~ /^\^(.*)$/) {
|
||||
|
||||
if ($atom =~ /^\^(.*)$/) { # get a list of nodes from a file
|
||||
open(NRF,$1);
|
||||
while (<NRF>) {
|
||||
my $line=$_;
|
||||
@ -229,24 +236,29 @@ sub noderange {
|
||||
close(NRF);
|
||||
next;
|
||||
}
|
||||
my %newset = map { $_ =>1 } expandatom($atom,$verify);
|
||||
if ($op =~ /@/) {
|
||||
|
||||
my %newset = map { $_ =>1 } expandatom($atom,$verify); # expand the atom and make each entry in the resulting array a key in newset
|
||||
|
||||
if ($op =~ /@/) { # compute the intersection of the current atom and the node list we have received before this
|
||||
foreach (keys %nodes) {
|
||||
unless ($newset{$_}) {
|
||||
delete $nodes{$_};
|
||||
}
|
||||
}
|
||||
} elsif ($op =~ /,-/) {
|
||||
} elsif ($op =~ /,-/) { # add the nodes from this atom to the exclude list
|
||||
foreach (keys %newset) {
|
||||
$delnodes{$_}=1; #delay removal to end
|
||||
}
|
||||
} else {
|
||||
} else { # add the nodes from this atom to the total node list
|
||||
foreach (keys %newset) {
|
||||
$nodes{$_}=1;
|
||||
}
|
||||
}
|
||||
$op = shift @elems;
|
||||
}
|
||||
|
||||
} # end of main while loop
|
||||
|
||||
# Now remove all the exclusion nodes
|
||||
foreach (keys %nodes) {
|
||||
if ($delnodes{$_}) {
|
||||
delete $nodes{$_};
|
||||
@ -254,7 +266,7 @@ sub noderange {
|
||||
}
|
||||
undef $nodelist;
|
||||
return sort (keys %nodes);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -300,7 +312,7 @@ A node plus offset (this increments the first number found in nodename):
|
||||
|
||||
node1+199
|
||||
|
||||
And most of the above substituting groupnames.
|
||||
And most of the above substituting groupnames.
|
||||
3C
|
||||
3C
|
||||
|
||||
@ -317,9 +329,5 @@ Jarrod Johnson (jbjohnso@us.ibm.com)
|
||||
|
||||
Copyright 2007 IBM Corp. All rights reserved.
|
||||
|
||||
TODO: What license is this?
|
||||
|
||||
|
||||
|
||||
|
||||
=cut
|
||||
|
@ -1,28 +1,28 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodels> -Lists the nodes in the noderange.
|
||||
|
||||
|
||||
B<nodels> - lists the nodes in the noderange.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
I<nodels [-h| --help]>
|
||||
|
||||
I<nodels [-v| --version]>
|
||||
|
||||
|
||||
I<nodels [-V| --verbose] noderange>
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
The nodels command lists the nodes in the input node range. If no noderange is provided, then all nodes are listed.
|
||||
|
||||
The nodels command lists the nodes specified in the node range. If no noderange is provided, then all nodes are listed.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
|
||||
B<-h> Display usage message.
|
||||
|
||||
B<-v> Command Version.
|
||||
B<-v> Command Version.
|
||||
|
||||
B<-V> Verbose output.
|
||||
B<-V> Verbose output.
|
||||
|
||||
|
||||
=head1 RETURN VALUE
|
||||
@ -33,9 +33,9 @@ B<-V> Verbose output.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
1. To list all defined nodes, enter:
|
||||
1. To list all defined nodes, enter:
|
||||
|
||||
I<nodels>
|
||||
I<nodels>
|
||||
|
||||
Output is similar to:
|
||||
node1
|
||||
@ -54,7 +54,7 @@ Output is similar to:
|
||||
|
||||
|
||||
=head1 FILES
|
||||
|
||||
|
||||
/opt/xcat/bin/nodels
|
||||
|
||||
|
||||
@ -63,4 +63,4 @@ Output is similar to:
|
||||
This command is part of the xCAT software product.
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
.\" Automatically generated by Pod::Man version 1.02
|
||||
.\" Wed Jan 9 08:40:29 2008
|
||||
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ======================================================================
|
||||
.\" ========================================================================
|
||||
.de Sh \" Subsection heading
|
||||
.br
|
||||
.if t .Sp
|
||||
@ -15,12 +14,6 @@
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Ip \" List item
|
||||
.br
|
||||
.ie \\n(.$>=3 .ne \\$3
|
||||
.el .ne 3
|
||||
.IP "\\$1" \\$2
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
@ -28,15 +21,14 @@
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
|
||||
.fi
|
||||
..
|
||||
.\" Set up some character translations and predefined strings. \*(-- will
|
||||
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
||||
.\" double quote, and \*(R" will give a right double quote. | will give a
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
|
||||
.\" to do unbreakable dashes and therefore won't be available. \*(C` and
|
||||
.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
|
||||
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
|
||||
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
|
||||
.\" expand to `' in nroff, nothing in troff, for use with C<>.
|
||||
.tr \(*W-|\(bv\*(Tr
|
||||
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
||||
.ie n \{\
|
||||
@ -46,8 +38,8 @@
|
||||
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
||||
. ds L" ""
|
||||
. ds R" ""
|
||||
. ds C` `
|
||||
. ds C' '
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds -- \|\(em\|
|
||||
@ -56,26 +48,25 @@
|
||||
. ds R" ''
|
||||
'br\}
|
||||
.\"
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr
|
||||
.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
|
||||
.\" index entries marked with X<> in POD. Of course, you'll have to process
|
||||
.\" the output yourself in some meaningful fashion.
|
||||
.\" If the F register is turned on, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
. .
|
||||
..
|
||||
. nr % 0
|
||||
. rr F
|
||||
.\}
|
||||
.\"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it
|
||||
.\" makes way too many mistakes in technical documents.
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.hy 0
|
||||
.if n .na
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
.bd B 3
|
||||
. \" fudge factors for nroff and troff
|
||||
.if n \{\
|
||||
. ds #H 0
|
||||
@ -135,13 +126,12 @@
|
||||
. ds Ae AE
|
||||
.\}
|
||||
.rm #[ #] #H #V #F C
|
||||
.\" ======================================================================
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "NODELS.1 1"
|
||||
.TH NODELS.1 1 "perl v5.6.0" "2008-01-09" "User Contributed Perl Documentation"
|
||||
.UC
|
||||
.TH NODELS.1 1 "2008-02-08" "perl v5.8.8" "User Contributed Perl Documentation"
|
||||
.SH "NAME"
|
||||
\&\fBnodels\fR \-Lists the nodes in the noderange.
|
||||
\&\fBnodels\fR \- lists the nodes in the noderange.
|
||||
.SH "SYNOPSIS"
|
||||
.IX Header "SYNOPSIS"
|
||||
\&\fInodels [\-h| \-\-help]\fR
|
||||
@ -149,17 +139,18 @@
|
||||
\&\fInodels [\-v| \-\-version]\fR
|
||||
.PP
|
||||
\&\fInodels [\-V| \-\-verbose] noderange\fR
|
||||
.SH "DESCRIPTION
|
||||
The nodels command lists the nodes in the input node range. If no noderange is provided, then all nodes are listed."
|
||||
.IX Header "DESCRIPTION
|
||||
The nodels command lists the nodes in the input node range. If no noderange is provided, then all nodes are listed."
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
.Vb 1
|
||||
\& The nodels command lists the nodes specified in the node range. If no noderange is provided, then all nodes are listed.
|
||||
.Ve
|
||||
.SH "OPTIONS"
|
||||
.IX Header "OPTIONS"
|
||||
\&\fB\-h\fR Display usage message.
|
||||
.PP
|
||||
\&\fB\-v\fR Command Version.
|
||||
\&\fB\-v\fR Command Version.
|
||||
.PP
|
||||
\&\fB\-V\fR Verbose output.
|
||||
\&\fB\-V\fR Verbose output.
|
||||
.SH "RETURN VALUE"
|
||||
.IX Header "RETURN VALUE"
|
||||
0 The command completed successfully.
|
||||
@ -167,9 +158,9 @@
|
||||
1 An error has occurred.
|
||||
.SH "EXAMPLES"
|
||||
.IX Header "EXAMPLES"
|
||||
1. To list all defined nodes, enter:
|
||||
1. To list all defined nodes, enter:
|
||||
.PP
|
||||
\&\fInodels\fR
|
||||
\&\fInodels\fR
|
||||
.PP
|
||||
Output is similar to:
|
||||
node1
|
||||
|
@ -21,10 +21,13 @@ node14-node56,node70-node203,group1-group10
|
||||
node1,node2,node8,node20,node14-node56,node70-node203
|
||||
.br
|
||||
|
||||
node[14-56]
|
||||
.br
|
||||
|
||||
all,-node129-node256,-frame01-frame03
|
||||
.br
|
||||
|
||||
@node.*
|
||||
/node.*
|
||||
.br
|
||||
|
||||
^/tmp/nodes
|
||||
@ -36,55 +39,68 @@ node10+5
|
||||
10-15,-13
|
||||
.br
|
||||
|
||||
group1@group2
|
||||
.br
|
||||
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
.B noderange
|
||||
is a function
|
||||
that a single
|
||||
operation may be applied to a range of nodes often in parallel.
|
||||
is a syntax that can be used in most xCAT commands to conveniently
|
||||
specify a list of nodes. The result is that the command will
|
||||
be applied to a range of nodes, often in parallel.
|
||||
|
||||
.B noderange
|
||||
lists can be an individual node and/or group:
|
||||
is a comma-separate list. Each token (text between commas) in the list can be any
|
||||
of the forms listed below:
|
||||
|
||||
Individual node or group:
|
||||
|
||||
.I node01
|
||||
.br
|
||||
.I group1
|
||||
.br
|
||||
|
||||
a range of nodes and/or groups:
|
||||
A range of nodes or groups:
|
||||
|
||||
.I node01-node10
|
||||
(equivalent to: node01,node02,node03,...node10)
|
||||
.br
|
||||
.I group1-group3
|
||||
(equivalent to: group1,group2,group3)
|
||||
.br
|
||||
|
||||
a regular expression match of nodes and/or groups:
|
||||
A regular expression match of nodes or groups:
|
||||
|
||||
.I @node[345].*
|
||||
.I /node[345].*
|
||||
(will match any nodes that start with node3, node4, or node5)
|
||||
.br
|
||||
.I @group[12].*
|
||||
.I /group[12].*
|
||||
(will match any groups that start with group1 or group2)
|
||||
.br
|
||||
|
||||
an incremented range of nodes:
|
||||
An incremented range of nodes:
|
||||
|
||||
.I node10+5
|
||||
.I node10+3
|
||||
(equivalent to: node10,node11,node12,node13)
|
||||
.br
|
||||
|
||||
a file containing noderanges of nodes and/or groups:
|
||||
The full path of a file containing noderanges of nodes or groups:
|
||||
|
||||
.I ^/tmp/nodelist
|
||||
.br
|
||||
|
||||
a node shorthand range of nodes:
|
||||
A node shorthand range of nodes:
|
||||
|
||||
.I 10-20
|
||||
(if prefix is 'node', equivalent to: node10,node11,node12,...node20)
|
||||
.br
|
||||
.I 10+5
|
||||
.I 10+3
|
||||
(if prefix is 'node', equivalent to: node10,node11,node12,node13)
|
||||
.br
|
||||
|
||||
or any combination:
|
||||
Or any combination:
|
||||
|
||||
.I node01-node30,node40,^/tmp/nodes,@node[13].*,2-10,node50+5
|
||||
.I node01-node30,node40,^/tmp/nodes,/node[13].*,2-10,node50+5
|
||||
.br
|
||||
|
||||
Any individual
|
||||
@ -92,6 +108,11 @@ Any individual
|
||||
may be prefixed with an exclusion operator
|
||||
(default -) with the exception of the file operator (default ^).
|
||||
|
||||
The intersection operator @ calculates the intersection of the left and right sides:
|
||||
|
||||
.I group1@group2
|
||||
(will result in the list of nodes group1 and group2 have in common)
|
||||
|
||||
Any combination or multiple combinations of inclusive
|
||||
and exclusive ranges of nodes and groups is legal. There
|
||||
is no precedence implied in the order of the
|
||||
@ -122,7 +143,7 @@ In plain english a node or group is in
|
||||
if starting from the begining there are one or more
|
||||
alpha characters of any case and any number of - in any
|
||||
combination, followed by
|
||||
one or more numbers, then optionally followed by one
|
||||
one or more numbers, then optionally followed by one
|
||||
alpha character of any case or the - followed by any
|
||||
combination of case mixed alphanumerics and the -.
|
||||
|
||||
@ -140,8 +161,8 @@ E.g. If using a
|
||||
of
|
||||
.I node1a-node9a
|
||||
with a
|
||||
.BR nodelist.tab (5)
|
||||
only listing
|
||||
.B nodelist
|
||||
table only listing
|
||||
.I node1a
|
||||
through
|
||||
.IR node5a ,
|
||||
@ -149,16 +170,16 @@ through
|
||||
will enumerate then validate and return a proper
|
||||
range. If using a node range of
|
||||
.I aa-az
|
||||
with
|
||||
.BR nodelist.tab (5)
|
||||
only listing
|
||||
with a
|
||||
.B nodelist
|
||||
table only listing
|
||||
.I aa
|
||||
through
|
||||
.IR ay,
|
||||
.B noderange
|
||||
will fail to return any values.
|
||||
|
||||
Example
|
||||
Example of
|
||||
\fIxCAT Node Format\fR
|
||||
node/group names:
|
||||
|
||||
@ -183,7 +204,7 @@ unit34rack01 unit 34 rack01
|
||||
pos0134 pos 0134
|
||||
.br
|
||||
|
||||
Example non-\fIxCAT Node Format\fR
|
||||
Example of non-\fIxCAT Node Format\fR
|
||||
node/group names, but still valid:
|
||||
|
||||
aa
|
||||
@ -196,7 +217,9 @@ red
|
||||
.br
|
||||
|
||||
|
||||
First
|
||||
The supported
|
||||
.B noderange
|
||||
syntaxes are checked for, and processed, in a specific order. First
|
||||
.B noderange
|
||||
checks for the multiple range operator (default ,). Each range is
|
||||
also processed by
|
||||
@ -204,7 +227,7 @@ also processed by
|
||||
|
||||
Next
|
||||
.B noderange
|
||||
checks for the file operator (default ^). If the file exists
|
||||
checks for the file operator (default ^). If the file exists (must be a full path name)
|
||||
each line will be processed as a
|
||||
.BR noderange .
|
||||
Lines starting
|
||||
@ -236,7 +259,7 @@ node03
|
||||
.br
|
||||
node10-node20
|
||||
.br
|
||||
@group[456].*
|
||||
/group[456].*
|
||||
.br
|
||||
-node50
|
||||
.br
|
||||
@ -246,41 +269,33 @@ Next
|
||||
checks for the exclusion operator (default -) then continues.
|
||||
This operator supports nodes and groups.
|
||||
.B noderange
|
||||
is smart and will not confuse the exclusion or range
|
||||
will not confuse the exclusion or range
|
||||
operators with the
|
||||
- character in names.
|
||||
|
||||
Next
|
||||
.B noderange
|
||||
checks for the for the regular expression operator (default @).
|
||||
Regular expressions offer the most flexibility. If you are
|
||||
interested in learing regex read the book
|
||||
\fIMastering Regular Expressions\fR.
|
||||
This operator supports nodes and groups.
|
||||
|
||||
Next
|
||||
.B noderange
|
||||
checks for a numeric only range (e.g. 10-20, 5+3, or just 10), then uses
|
||||
.I $XCAT_NODE_PREFIX
|
||||
and
|
||||
(default is 'node') and
|
||||
.I $XCAT_NODE_SUFFIX
|
||||
(optional)
|
||||
as the defaults to complete the node names.
|
||||
.I $XCAT_NODE_PREFIX
|
||||
must be defined to use noderange
|
||||
shorthand. If you use padded node names (e.g. node001, node002, etc...)
|
||||
then you must specify
|
||||
.I $XCAT_NODE_PADDING
|
||||
or the default of
|
||||
.I 1
|
||||
will be used. E.g. if you use node names node001, node002, etc..., then
|
||||
.I $XCAT_NODE_PADDING
|
||||
should be set to
|
||||
.IR 3 .
|
||||
.B nodeRange
|
||||
tries to be intelligent about detecting padding, so you can specify 'node001-node200'
|
||||
and it will add the proper number of zeroes to make all numbers 3 digits.
|
||||
Noderange shorthand supports nodes only. Noderange shorthand can
|
||||
be mixed with all other operators except regex. i.e. exclusion,
|
||||
increment, range, and file may be used.
|
||||
|
||||
Next
|
||||
.B noderange
|
||||
checks for the for the regular expression operator (default /).
|
||||
Regular expressions offer the most flexibility. If you are
|
||||
interested in learning regex read the book
|
||||
\fIMastering Regular Expressions\fR.
|
||||
This operator supports nodes and groups.
|
||||
|
||||
Next
|
||||
.B noderange
|
||||
checks for the increment range operator (default +). Increment
|
||||
@ -293,7 +308,7 @@ e.g.
|
||||
.I node10+5
|
||||
|
||||
would yield node10 plus the next
|
||||
.I 4
|
||||
.I 5
|
||||
nodes.
|
||||
|
||||
This action is performed using two different methods.
|
||||
@ -301,13 +316,13 @@ If
|
||||
.I valid_node_name
|
||||
is in
|
||||
\fIxCAT Node Format\fR
|
||||
then the range is enumerated to one less than
|
||||
then the range is enumerated to
|
||||
.IR number_of_sequential_nodes .
|
||||
If not in
|
||||
\fIxCAT Node Format\fR
|
||||
then a sorted
|
||||
.BR nodelist.tab (5)
|
||||
is used to return the node range.
|
||||
.B nodelist
|
||||
table is used to return the node range.
|
||||
This operator supports nodes only.
|
||||
|
||||
Next
|
||||
@ -319,11 +334,11 @@ Next
|
||||
checks for the range operator (default -). Ranges are
|
||||
performed first by validating that both the start
|
||||
and end nodes or groups defining the range exist and if
|
||||
so the range is returned based on the content of
|
||||
.BR nodelist.tab (5),
|
||||
.BR nodetype.tab (5),
|
||||
so the range is returned based on the content of the
|
||||
.B nodelist
|
||||
and
|
||||
.BR nodemodel.tab (5).
|
||||
.B nodetype
|
||||
tables.
|
||||
If the start and end nodes or groups
|
||||
defined in the range do not exist,
|
||||
.I and
|
||||
@ -334,7 +349,7 @@ if both the prefix and suffix match,
|
||||
then the range is enumerated and each node/group
|
||||
validated. Only valid nodes/groups will be returned.
|
||||
.B noderange
|
||||
is smart and will not confuse the exclusion or range
|
||||
will not confuse the exclusion or range
|
||||
operators with the
|
||||
- character in names.
|
||||
|
||||
@ -358,9 +373,9 @@ will only be listed once.
|
||||
.I all,-node5-node10
|
||||
|
||||
Generates a list of all nodes (assuming all is a group)
|
||||
listed in
|
||||
.BR nodelist.tab (5)
|
||||
less node5 through node10.
|
||||
listed in the
|
||||
.B nodelist
|
||||
table less node5 through node10.
|
||||
|
||||
.I node1-node10,-node3-node5,node4
|
||||
|
||||
@ -374,9 +389,9 @@ Generates a list of nodes 1 through 10 less nodes 3 and 5.
|
||||
|
||||
.I -node17-node32,all
|
||||
|
||||
Generates a list of all (assuming 'all' is a group) nodes in
|
||||
.BR nodelist.tab (5)
|
||||
less 17 through 32.
|
||||
Generates a list of all (assuming 'all' is a group) nodes in the
|
||||
.B nodelist
|
||||
table less 17 through 32.
|
||||
|
||||
.I node1-node128,user1-user4
|
||||
|
||||
@ -390,7 +405,7 @@ rack2, and rack3 are defined), less nodes 100 through
|
||||
200, less nodes in the storage group. Note that
|
||||
node150 is listed but is excluded.
|
||||
|
||||
.I @node[23].*
|
||||
.I /node[23].*
|
||||
|
||||
Generates a list of nodes matching the regex
|
||||
.IR node[23].* .
|
||||
@ -399,4 +414,4 @@ or nothing. E.g. node2, node3, node20, node30, node21234 all match.
|
||||
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
This command is part of the xCAT software product.
|
||||
This command is part of the xCAT software.
|
||||
|
@ -67,7 +67,7 @@ stop)
|
||||
fi
|
||||
kill -TERM -`cat /var/run/xcatd.pid`
|
||||
let i=0;
|
||||
while $STATUS >& /dev/null && [ $i -lt 15 ]; do
|
||||
while $STATUS >& /dev/null && [ $i -lt 15 ]; do
|
||||
usleep 100000
|
||||
let i=i+1
|
||||
done
|
||||
@ -92,8 +92,13 @@ start)
|
||||
exit
|
||||
fi
|
||||
echo -n "Starting xCATd "
|
||||
xcatroot=`head -n1 /etc/profile.d/xcat.sh`
|
||||
export $xcatroot
|
||||
#xcatroot=`head -n1 /etc/profile.d/xcat.sh`
|
||||
#export $xcatroot
|
||||
# When this script is invoked via the service cmd on RH, it doesn't have PATH
|
||||
# set either, so we run our profile entry to get everything set up properly.
|
||||
if [ -r /etc/profile.d/xcat.sh ]; then
|
||||
. /etc/profile.d/xcat.sh
|
||||
fi
|
||||
xcatd -p /var/run/xcatd.pid && $LOG_SUCCESS || $LOG_FAILURE
|
||||
;;
|
||||
esac
|
||||
|
@ -62,8 +62,8 @@ then
|
||||
|
||||
# Update the apache config
|
||||
echo "Updating $apachedaemon configuration for xCAT..."
|
||||
/bin/rm -f /etc/$apachedaemon/conf.d/xcat.conf
|
||||
/bin/ln -s %{prefix}/web/etc/apache2/conf.d/xcat.conf /etc/$apachedaemon/conf.d/xcat.conf
|
||||
/bin/rm -f /etc/$apachedaemon/conf.d/xcat-web.conf
|
||||
/bin/ln -s %{prefix}/web/etc/apache2/conf.d/xcat-web.conf /etc/$apachedaemon/conf.d/xcat-web.conf
|
||||
/etc/init.d/$apachedaemon reload
|
||||
|
||||
# Link to the grpattr cmd. Todo: remove this when it is in base xcat
|
||||
@ -76,6 +76,10 @@ then
|
||||
echo "Configuring sudo for $apacheuser..."
|
||||
echo "$apacheuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
||||
fi
|
||||
# Authorize the apacheuser to xcatd
|
||||
# echo -e "y\ny\ny" | %{prefix}/share/xcat/scripts/setup-local-client.sh $apacheuser
|
||||
# XCATROOT=%{prefix} %{prefix}/sbin/chtab priority=5 policy.name=$apacheuser policy.rule=allow
|
||||
|
||||
fi
|
||||
|
||||
if [ "$1" = 1 ] || [ "$1" = 2 ] # initial install, or upgrade and this is the newer rpm
|
||||
@ -103,7 +107,7 @@ then
|
||||
|
||||
# Remove links made during the post install script
|
||||
echo "Undoing $apachedaemon configuration for xCAT..."
|
||||
/bin/rm -f /etc/$apachedaemon/conf.d/xcat.conf
|
||||
/bin/rm -f /etc/$apachedaemon/conf.d/xcat-web.conf
|
||||
/etc/init.d/$apachedaemon reload
|
||||
/bin/rm -f %{prefix}/bin/grpattr
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user