STORM-248 use os.path.join instead or mere path concatenation

Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/fba310af
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/fba310af
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/fba310af

Branch: refs/heads/master
Commit: fba310af8cc2796af9314bd26217fe08552ad49c
Parents: 14a828c
Author: fmazoyer <[email protected]>
Authored: Tue Jan 6 16:27:19 2015 +0100
Committer: fmazoyer <[email protected]>
Committed: Tue Jan 6 16:27:19 2015 +0100

----------------------------------------------------------------------
 bin/storm | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/fba310af/bin/storm
----------------------------------------------------------------------
diff --git a/bin/storm b/bin/storm
index 345bcbe..a2e641d 100755
--- a/bin/storm
+++ b/bin/storm
@@ -74,7 +74,8 @@ if (not os.path.isfile(os.path.join(USER_CONF_DIR, 
"storm.yaml"))):
 STORM_RELEASE_DIR = os.path.join(STORM_DIR, "RELEASE")
 STORM_LIB_DIR = os.path.join(STORM_DIR, "lib")
 STORM_BIN_DIR = os.path.join(STORM_DIR, "bin")
-STORM_LOGBACK_FILE_PATH = os.path.join(STORM_DIR, "logback", "cluster.xml")
+STORM_LOGBACK_DIR = os.path.join(STORM_DIR, "logback")
+STORM_LOGBACK_FILE_PATH = os.path.join(STORM_LOGBACK_DIR, "cluster.xml")
 
 init_storm_env()
 
@@ -228,7 +229,7 @@ def upload_credentials(*args):
         "backtype.storm.command.upload_credentials", 
         args=args, 
         jvmtype="-client", 
-        extrajars=[USER_CONF_DIR, STORM_DIR + "/bin"])
+        extrajars=[USER_CONF_DIR, STORM_BIN_DIR])
 
 def activate(*args):
     """Syntax: [storm activate topology-name]
@@ -316,7 +317,7 @@ def get_logback_conf_dir():
     cppaths = [CLUSTER_CONF_DIR]
     storm_logback_conf_dir = confvalue("storm.logback.conf.dir", cppaths)
     if(storm_logback_conf_dir == None or storm_logback_conf_dir == "nil"):
-        storm_logback_conf_dir = STORM_DIR + "/logback"
+        storm_logback_conf_dir = STORM_LOGBACK_DIR
     return storm_logback_conf_dir
 
 def nimbus(klass="backtype.storm.daemon.nimbus"):
@@ -331,7 +332,7 @@ def nimbus(klass="backtype.storm.daemon.nimbus"):
     cppaths = [CLUSTER_CONF_DIR]
     jvmopts = parse_args(confvalue("nimbus.childopts", cppaths)) + [
         "-Dlogfile.name=nimbus.log",
-        "-Dlogback.configurationFile=" + get_logback_conf_dir() + 
"/cluster.xml",
+        "-Dlogback.configurationFile=" + os.path.join(get_logback_conf_dir(), 
"cluster.xml"),
     ]
     exec_storm_class(
         klass, 
@@ -351,7 +352,7 @@ def supervisor(klass="backtype.storm.daemon.supervisor"):
     cppaths = [CLUSTER_CONF_DIR]
     jvmopts = parse_args(confvalue("supervisor.childopts", cppaths)) + [
         "-Dlogfile.name=supervisor.log",
-        "-Dlogback.configurationFile=" + get_logback_conf_dir() + 
"/cluster.xml",
+        "-Dlogback.configurationFile=" + os.path.join(get_logback_conf_dir(), 
"cluster.xml"),
     ]
     exec_storm_class(
         klass, 
@@ -372,7 +373,7 @@ def ui():
     cppaths = [CLUSTER_CONF_DIR]
     jvmopts = parse_args(confvalue("ui.childopts", cppaths)) + [
         "-Dlogfile.name=ui.log",
-        "-Dlogback.configurationFile=" + get_logback_conf_dir() + 
"/cluster.xml"
+        "-Dlogback.configurationFile=" + os.path.join(get_logback_conf_dir(), 
"cluster.xml")
     ]
     exec_storm_class(
         "backtype.storm.ui.core", 
@@ -393,7 +394,7 @@ def logviewer():
     cppaths = [CLUSTER_CONF_DIR]
     jvmopts = parse_args(confvalue("logviewer.childopts", cppaths)) + [
         "-Dlogfile.name=logviewer.log",
-        "-Dlogback.configurationFile=" + get_logback_conf_dir() + 
"/cluster.xml"
+        "-Dlogback.configurationFile=" + os.path.join(get_logback_conf_dir(), 
"cluster.xml")
     ]
     exec_storm_class(
         "backtype.storm.daemon.logviewer", 
@@ -413,7 +414,7 @@ def drpc():
     cppaths = [CLUSTER_CONF_DIR]
     jvmopts = parse_args(confvalue("drpc.childopts", cppaths)) + [
         "-Dlogfile.name=drpc.log",
-        "-Dlogback.configurationFile=" + get_logback_conf_dir() + 
"/cluster.xml"
+        "-Dlogback.configurationFile=" + os.path.join(get_logback_conf_dir(), 
"cluster.xml")
     ]
     exec_storm_class(
         "backtype.storm.daemon.drpc", 

Reply via email to