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 2015/04/28 17:54:24 UTC
incubator-slider git commit: SLIDE-863 TestActionList
Repository: incubator-slider
Updated Branches:
refs/heads/feature/SLIDER-863-windows-tests 788e3d204 -> fc0343b60
SLIDE-863 TestActionList
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/fc0343b6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/fc0343b6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/fc0343b6
Branch: refs/heads/feature/SLIDER-863-windows-tests
Commit: fc0343b60a6eb42dc473bb876563fc860e6e4296
Parents: 788e3d2
Author: Steve Loughran <st...@apache.org>
Authored: Tue Apr 28 16:54:14 2015 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Tue Apr 28 16:54:14 2015 +0100
----------------------------------------------------------------------
.../org/apache/slider/client/SliderClient.java | 25 +++++++++++++-------
1 file changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/fc0343b6/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
index 6e6503c..51e2b16 100644
--- a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
+++ b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
@@ -1308,11 +1308,11 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
AbstractClientProvider
provider = createClientProvider(SliderProviderFactory.DEFAULT_CLUSTER_TYPE);
provider.processClientOperation(sliderFileSystem,
- "INSTALL",
- clientInfo.installLocation,
- pkgFile,
- config,
- clientInfo.name);
+ "INSTALL",
+ clientInfo.installLocation,
+ pkgFile,
+ config,
+ clientInfo.name);
return EXIT_SUCCESS;
}
@@ -1495,9 +1495,18 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
.getPathWithoutSchemeAndAuthority(fileInFs).toString();
String destHomeDir = Path.getPathWithoutSchemeAndAuthority(
sliderFileSystem.getFileSystem().getHomeDirectory()).toString();
- String destPathWithoutHomeDir = destPathWithHomeDir.replaceFirst(
- destHomeDir + File.separatorChar, StringUtils.EMPTY);
- println("\nSet " + AgentKeys.APP_DEF + " in your app config JSON to = %s\n",
+ // a somewhat contrived approach to stripping out the home directory and any trailing
+ // separator; designed to work on windows and unix
+ String destPathWithoutHomeDir;
+ if (destPathWithHomeDir.startsWith(destHomeDir)) {
+ destPathWithoutHomeDir = destPathWithHomeDir.substring(destHomeDir.length());
+ if (destPathWithoutHomeDir.startsWith("/") || destPathWithoutHomeDir.startsWith("\\")) {
+ destPathWithoutHomeDir = destPathWithoutHomeDir.substring(1);
+ }
+ } else {
+ destPathWithoutHomeDir = destPathWithHomeDir;
+ }
+ log.info("Set " + AgentKeys.APP_DEF + " in your app config JSON to {}",
destPathWithoutHomeDir);
return EXIT_SUCCESS;