From ccba97c0880cf0fdb336cc4f9d330baed45345d1 Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 30 Jun 2009 11:28:26 +0000 Subject: [PATCH] selection string change effects the *def commands -m and -p flag git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3668 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DBobjUtils.pm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index d83cefab6..67f4fa4a5 100644 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -1050,6 +1050,13 @@ sub setobjdefs } my $val; + my $delim = ','; + if(($type eq 'group') && ($DBattrvals{$objname}{'grouptype'} eq 'dynamic')) + { + # dynamic node group selection string use "::" as delimiter + $delim = '::'; + } + if ($::plus_option) { @@ -1058,8 +1065,8 @@ sub setobjdefs { # add the attr into the list if it's not already in the list! # and avoid the duplicate values - my @DBattrarray = split(',', $DBattrvals{$objname}{$attr_name}); - my @objhasharray = split(',', $objhash{$objname}{$attr_name}); + my @DBattrarray = split(/$delim/, $DBattrvals{$objname}{$attr_name}); + my @objhasharray = split(/$delim/, $objhash{$objname}{$attr_name}); foreach my $objattr (@objhasharray) { if (!grep(/^\Q$objattr\E$/, @DBattrarray)) @@ -1067,7 +1074,7 @@ sub setobjdefs push @DBattrarray, $objattr; } } - $val = join(',', @DBattrarray); + $val = join($delim, @DBattrarray); } else { @@ -1085,8 +1092,8 @@ sub setobjdefs # get the list of attrs to remove my @currentList = - split(/,/, $DBattrvals{$objname}{$attr_name}); - my @minusList = split(/,/, $objhash{$objname}{$attr_name}); + split(/$delim/, $DBattrvals{$objname}{$attr_name}); + my @minusList = split(/$delim/, $objhash{$objname}{$attr_name}); # make a new list without the one specified my $first = 1; @@ -1100,7 +1107,7 @@ sub setobjdefs # set new list for node if (!$first) { - $newlist .= ","; + $newlist .= "$delim"; } $newlist .= $i; $first = 0;