From cde3cf828ea5146c935235df57b8eb6528594dee Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 17 Jul 2008 13:44:56 +0000 Subject: [PATCH] -Change noderange to make , lower precedence operator than @ -Have xCAT metapackage ensure the expected permissions on ssh public key on the postscripts section. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1884 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NodeRange.pm | 12 ++++++++---- xCAT/xCAT.spec | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index 4b7ab5a82..e3ff4599f 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -43,6 +43,10 @@ sub expandatom { $recurselevel++; return noderange($atom); } + if ($atom =~ /@/) { + $recurselevel++; + return noderange($atom); + } # Try to match groups? foreach($nodelist->getAllAttribs('node','groups')) { @@ -212,8 +216,6 @@ sub retain_cache { #A semi private operation to be used *ONLY* in the interestin sub noderange { $missingnodes=[]; #We for now just do left to right operations - #TODO: Parentheses... A parenthetical group to the right of an intersection makes the obvious - #answer not work my $range=shift; my $verify = (scalar(@_) == 1 ? shift : 1); unless ($nodelist) { @@ -225,8 +227,10 @@ sub noderange { my %nodes = (); my %delnodes = (); my $op = ","; - #my @elems = split(/(,(?![^[]*?])|@)/,$range); #, or @ but ignore , within [] - my @elems = split(/(,(?![^[]*?])(?![^\(]*?\))|@(?![^\(]*?\)))/,$range); # comma or @ but ignore comma within [] + my @elems = split(/(,(?![^[]*?])(?![^\(]*?\)))/,$range); # commas outside of [] or () + if (scalar(@elems)==1) { + @elems = split(/(@(?![^\(]*?\)))/,$range); # only split on @ when no , are present (inner recursion) + } while (my $atom = shift @elems) { if ($atom =~ /^-/) { # if this is an exclusion, strip off the minus, but remember it diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 443a3d12c..0401bfe90 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -131,6 +131,7 @@ if [ "$1" = "1" ]; then #Only if installing for the fist time.. fi mkdir -p /install/postscripts/_ssh cp /root/.ssh/id_rsa.pub /install/postscripts/_ssh/authorized_keys + chmod 644 /install/postscripts/_ssh/authorized_keys mkdir -p /var/log/consoles if ! grep /tftpboot /etc/exports; then