diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 67f4fa4a5..d3a23cfcc 100644 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -1592,9 +1592,8 @@ sub getGroupMembers { my $rsp; $rsp->{data}->[0] = - "The \'-w\' option has an incorrect attr=val pair."; + "The \'-w\' option has an incorrect attr*val pair."; xCAT::MsgUtils->message("E", $rsp, $::callback); - next; } # see what nodes have these attr=values diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index a81dbdecf..f5a021c1d 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -4221,23 +4221,25 @@ sub parse_selection_string() { my ($class, $ss_ref, $wherehash_ref) = @_; + # selection string is specified with one or multiple -w flags + # stored in an array foreach my $m (@{$ss_ref}) { my $attr; my $val; my $matchtype; - if ($m =~ /^[^=]*\==/) { + if ($m =~ /^[^=]*\==/) { #attr==val ($attr, $val) = split /==/,$m,2; $matchtype='match'; - } elsif ($m =~ /^[^=]*=~/) { + } elsif ($m =~ /^[^=]*=~/) { #attr=~val ($attr, $val) = split /=~/,$m,2; $val =~ s/^\///; $val =~ s/\/$//; $matchtype='regex'; - } elsif ($m =~ /^[^=]*\!=/) { + } elsif ($m =~ /^[^=]*\!=/) { #attr!=val ($attr,$val) = split /!=/,$m,2; $matchtype='natch'; - } elsif ($m =~ /[^=]*!~/) { + } elsif ($m =~ /[^=]*!~/) { #attr!~val ($attr,$val) = split /!~/,$m,2; $val =~ s/^\///; $val =~ s/\/$//; @@ -4300,7 +4302,7 @@ sub selection_string_match() last; } } - if(($wherehash{$testattr}{'matchtype'} eq 'natch')) { #attr!=val + if($wherehash{$testattr}{'matchtype'} eq 'natch') { #attr!=val if ($objhash_ref->{$objname}->{$testattr} eq $wherehash{$testattr}{'val'}) { $match = 0; last; diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index f5e658be1..3d068e316 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1584,7 +1584,7 @@ sub defch if ($rc != 0) { my $rsp; - $rsp->{data}->[0] = "Incorrect selection string specified with -m flag"; + $rsp->{data}->[0] = "Incorrect selection string"; xCAT::MsgUtils->message("E", $rsp, $::callback); return 3; } @@ -2938,7 +2938,7 @@ sub defmk_usage $rsp->{data}->[2] = " mkdef [-V | --verbose] [-t object-types] [-o object-names] [-z|--stanza ]"; $rsp->{data}->[3] = - " [-d | --dynamic] [-w \"attr==val\" [-w \"attr=~val\"] ...]"; + " [-d | --dynamic] [-w attr==val [-w attr=~val] ...]"; $rsp->{data}->[4] = " [-f | --force] [noderange] [attr=val [attr=val...]]\n"; $rsp->{data}->[5] = @@ -2987,7 +2987,7 @@ sub defch_usage $rsp->{data}->[3] = " [-z | --stanza] [-m | --minus] [-p | --plus]"; $rsp->{data}->[4] = - " [-w \"attr==val\" [-w \"attr=~val\"] ... ] [noderange] [attr=val [attr=val...]]\n"; + " [-w attr==val [-w attr=~val] ... ] [noderange] [attr=val [attr=val...]]\n"; $rsp->{data}->[5] = "\nThe following data object types are supported by xCAT.\n"; my $n = 6; @@ -3033,7 +3033,7 @@ sub defls_usage $rsp->{data}->[3] = " [ -l | --long] [-a | --all] [-z | --stanza ]"; $rsp->{data}->[4] = - " [-i attr-list] [-w \"attr==val\" [-w \"attr=~val\"] ...] [noderange]\n"; + " [-i attr-list] [-w attr==val [-w attr=~val] ...] [noderange]\n"; $rsp->{data}->[5] = "\nThe following data object types are supported by xCAT.\n"; my $n = 6;