From 424b8b5378da5e7ca807d869657b4a245aee5447 Mon Sep 17 00:00:00 2001 From: asirxing Date: Sun, 6 Jan 2013 01:48:59 +0000 Subject: [PATCH] Fix the regular expression issue for list_all_nodegroups function git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14755 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/TableUtils.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/TableUtils.pm b/perl-xCAT/xCAT/TableUtils.pm index 735835834..e266dad59 100644 --- a/perl-xCAT/xCAT/TableUtils.pm +++ b/perl-xCAT/xCAT/TableUtils.pm @@ -101,7 +101,7 @@ sub list_all_node_groups my @groupnames = split ",", $gnames; foreach my $groupname (@groupnames) { - if (!grep(/$groupname/, @distinctgroups)) + if (!grep(/^$groupname$/, @distinctgroups)) { # not already in list push @distinctgroups, $groupname; } @@ -123,7 +123,7 @@ sub list_all_node_groups foreach my $group (@grouplist) { my $groupname = $group->{groupname}; - if (!grep(/$groupname/, @distinctgroups)) + if (!grep(/^$groupname$/, @distinctgroups)) { # not already in list push @distinctgroups, $groupname; }