Repository: incubator-slider
Updated Branches:
  refs/heads/develop e3021a045 -> 9318aea87


SLIDER-734 Incorporate changes from cluster testing


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

Branch: refs/heads/develop
Commit: 9318aea8798997913374345ade602def63457a1c
Parents: e3021a0
Author: tedyu <[email protected]>
Authored: Wed Apr 1 14:40:40 2015 -0700
Committer: tedyu <[email protected]>
Committed: Wed Apr 1 14:40:40 2015 -0700

----------------------------------------------------------------------
 app-packages/hbase/hbase-slider.py | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9318aea8/app-packages/hbase/hbase-slider.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase/hbase-slider.py 
b/app-packages/hbase/hbase-slider.py
index 83b9658..dc32b0d 100644
--- a/app-packages/hbase/hbase-slider.py
+++ b/app-packages/hbase/hbase-slider.py
@@ -21,6 +21,7 @@
 First argument is the name of cluster instance
 """
 import os
+import subprocess
 from os.path import expanduser
 from os.path import exists
 import glob
@@ -45,17 +46,6 @@ import hashlib
 import random
 import httplib, ssl
 
-SLIDER_DIR = os.getenv('SLIDER_HOME', None)
-if SLIDER_DIR == None or (not os.path.exists(SLIDER_DIR)):
-  SLIDER_CMD = which("slider")
-  if SLIDER_DIR == None:
-    print "Unable to find SLIDER_HOME or slider command. Please configure 
SLIDER_HOME before running hbase-slider"
-    sys.exit(1)
-else:
-  SLIDER_CMD = os.path.join(SLIDER_DIR, 'bin', 'slider.py')
-
-HBASE_TMP_DIR=os.path.join(tempfile.gettempdir(), "hbase-temp")
-
 # find path to given command
 def which(program):
     def is_exe(fpath):
@@ -73,6 +63,20 @@ def which(program):
                 return exe_file
     return None
 
+SLIDER_DIR = os.getenv('SLIDER_HOME', None)
+if SLIDER_DIR == None or (not os.path.exists(SLIDER_DIR)):
+  SLIDER_CMD = which("slider")
+  if SLIDER_DIR == None:
+    if os.path.exists("/usr/bin/slider"):
+      SLIDER_CMD = "/usr/bin/slider"
+    else:
+      print "Unable to find SLIDER_HOME or slider command. Please configure 
SLIDER_HOME before running hbase-slider"
+      sys.exit(1)
+else:
+  SLIDER_CMD = os.path.join(SLIDER_DIR, 'bin', 'slider.py')
+
+HBASE_TMP_DIR=os.path.join(tempfile.gettempdir(), "hbase-temp")
+
 # call slider command
 def call(cmd):
   print "Running: " + " ".join(cmd)
@@ -221,6 +225,7 @@ except getopt.GetoptError as err:
   print str(err)
   sys.exit(2)
 
+cluster_instance=args[0]
 local_conf_dir=os.path.join(home, cluster_instance, 'conf')
 hbase_conf_dir="/etc/hbase/conf"
 ttl=0
@@ -232,7 +237,6 @@ for o, a in opts:
   elif o == "--ttl":
     ttl = a
 
-cluster_instance=args[0]
 if len(args) > 1:
   if args[1] == 'quicklinks':
     quicklinks(cluster_instance)

Reply via email to