selection string code updates based on review meeting comments
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3705 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user