Why the rc is a big number in STAF 3.4.8?

SparkFan
2012-03-15
2013-06-12
  • SparkFan

    SparkFan - 2012-03-15

    Hi folks,

    Why the rc is a big number in STAF3.4.8 instead of 0 in STAF3.4.1?
    Is it designed, or a bug?

    408:       my $result = STAFExecuteCmd(Cmd => "RESOLVE STRING {$var}",
    409:                                   Service => "VAR",
    410:                                   Host => $host);

      DB<4> x $result
    0  STAF::STAFResult=HASH(0x9d918a4)
       'rc' => 13816197273337462784    <===== It was 0 in STAF3.4.1
       'result' => 'Linux'
       'resultContext' => STAF::STAFMarshallingContext=HASH(0x9d906fc)
          'mapClassMap' => HASH(0x9d904e0)
               empty hash
          'rootObject' => 'Linux'
       'resultObj' => 'Linux'

    DB<11> x $var
    0  'STAF/Config/OS/Name'

    Thanks,
    -Spark

     
  • Sharon Lucas

    Sharon Lucas - 2012-03-15

    The result is still 0 for a successful VAR RESOLVE request in STAF V3.4.8. 

    For example, if I run the following Perl program using STAF V3.4.8 to resolve the {STAF/Config/OS/Name} variable, it shows the RC is 0.  Try running this Perl program to see if the RC is 0.

    use PLSTAF;
    my $handle = STAF::STAFHandle->new("Test");
    if ($rc != $STAF::kOk) {
        print "Error registering with STAF, RC: $STAF::RC\n";
        exit $rc;
    }
    my $var = "STAF/Config/OS/Name";
    my $machine = "local";
    my $service = "VAR";
    my $request = "RESOLVE STRING {$var}";
    my $stafCmd = "STAF $machine $service $request";
    print "$stafCmd\n";
    my $result = $handle->submit($machine, $service, $request);
    print "RC: $result->{rc}, Result: $result->{result}\n";
    $rc = $handle->unRegister();
    if ($rc != $STAF::kOk) {
        print "Error unregistering with STAF, RC: $STAF::RC\n";
    }
    

    When I run it, the RC from submitting the VAR RESOLVE request is 0:

    # perl TestVar.pl
    STAF local VAR RESOLVE STRING {STAF/Config/OS/Name}
    RC: 0, Result: Linux
    
     
  • Sharon Lucas

    Sharon Lucas - 2012-03-15

    I meant, the RC (not result) is still 0 for a successful VAR RESOLVE request.

     

Log in to post a comment.