You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by go...@apache.org on 2016/04/13 08:13:09 UTC

[7/8] incubator-slider git commit: SLIDER-777 Provide slider dependencies as a self contained versioned tarball - accept system property as a higher priority

SLIDER-777 Provide slider dependencies as a self contained versioned tarball - accept system property as a higher priority


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

Branch: refs/heads/feature/SLIDER-906_docker_support
Commit: 4b4e24f6c2bcc491b4754085935094c739e33a79
Parents: 9263426
Author: Gour Saha <go...@apache.org>
Authored: Tue Apr 12 20:34:52 2016 -0700
Committer: Gour Saha <go...@apache.org>
Committed: Tue Apr 12 20:34:52 2016 -0700

----------------------------------------------------------------------
 .../org/apache/slider/common/tools/SliderUtils.java    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/4b4e24f6/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java b/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
index 5f5599c..b9c7b8e 100644
--- a/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
+++ b/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
@@ -1884,12 +1884,19 @@ public final class SliderUtils {
   }
 
   /**
-   * Retrieve the HDP version if it is an HDP cluster, or null otherwise
+   * Retrieve the HDP version if it is an HDP cluster, or null otherwise. It
+   * first checks if system property HDP_VERSION is defined. If not it checks if
+   * system env HDP_VERSION is defined.
    * 
-   * @return HDP version
+   * @return HDP version (if defined) or null otherwise
    */
   public static String getHdpVersion() {
-    return System.getenv(SliderKeys.HDP_VERSION_PROP_NAME);
+    String hdpVersion = System
+        .getProperty(SliderKeys.HDP_VERSION_PROP_NAME);
+    if (StringUtils.isEmpty(hdpVersion)) {
+      hdpVersion = System.getenv(SliderKeys.HDP_VERSION_PROP_NAME);
+    }
+    return hdpVersion;
   }
 
   /**