You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/10/30 15:35:37 UTC

git commit: SLIDER-581 moving where the exit codes are set up/using non superclass exec

Repository: incubator-slider
Updated Branches:
  refs/heads/feature/SLIDER-581_funtest_return_values_on_windows 2d953fff1 -> 518d7508c


SLIDER-581 moving where the exit codes are set up/using non superclass exec


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/518d7508
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/518d7508
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/518d7508

Branch: refs/heads/feature/SLIDER-581_funtest_return_values_on_windows
Commit: 518d7508c239692db60722fb2cbe9805551b66f0
Parents: 2d953ff
Author: Steve Loughran <st...@apache.org>
Authored: Thu Oct 30 14:34:33 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Thu Oct 30 14:34:33 2014 +0000

----------------------------------------------------------------------
 .../apache/slider/funtest/framework/SliderShell.groovy | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/518d7508/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/SliderShell.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/SliderShell.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/SliderShell.groovy
index c101cfa..43ac477 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/SliderShell.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/SliderShell.groovy
@@ -79,9 +79,14 @@ class SliderShell extends Shell {
     List<String> commandLine = buildEnvCommands()
 
     commandLine << command
+    if (org.apache.hadoop.util.Shell.WINDOWS) {
+      // Ensure the errorlevel returned by last call is set for the invoking shell
+      commandLine << "@echo ERRORLEVEL=%ERRORLEVEL%"
+      commandLine << "@exit %ERRORLEVEL%"
+    }
     String script = commandLine.join("\n")
     log.debug(script)
-    super.exec(script);
+    exec(script);
     signCorrectReturnCode()
     return ret;
   }
@@ -251,12 +256,6 @@ class SliderShell extends Shell {
       def writer = new PrintWriter(new BufferedOutputStream(proc.out))
       writer.println(script)
       writer.flush()
-      if (org.apache.hadoop.util.Shell.WINDOWS) {
-        // Ensure the errorlevel returned by last call is set for the invoking shell
-        writer.println("@echo ERRORLEVEL=%ERRORLEVEL%")
-        writer.println("@exit %ERRORLEVEL%")
-        writer.flush()
-      }
       writer.close()
     }