You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/06/23 17:19:21 UTC
[10/22] git commit: Merge branch 'STORM-320' of
https://github.com/chu11/incubator-storm into storm-320
Merge branch 'STORM-320' of https://github.com/chu11/incubator-storm into storm-320
STORM-320: Support STORM_CONF_DIR environment variable to support
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/51a75fbb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/51a75fbb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/51a75fbb
Branch: refs/heads/security
Commit: 51a75fbb5e238e330a5fbc99360520f29b822059
Parents: 093ce72 c7b2238
Author: Derek Dagit <de...@yahoo-inc.com>
Authored: Thu Jun 19 16:53:40 2014 -0500
Committer: Derek Dagit <de...@yahoo-inc.com>
Committed: Thu Jun 19 16:53:40 2014 -0500
----------------------------------------------------------------------
bin/storm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/51a75fbb/bin/storm
----------------------------------------------------------------------
diff --cc bin/storm
index c9885a2,bd11432..2c72679
--- a/bin/storm
+++ b/bin/storm
@@@ -35,28 -35,22 +35,34 @@@ def cygpath(x)
lines = output.split("\n")
return lines[0]
-if sys.platform == "cygwin":
- normclasspath = cygpath
-else:
- normclasspath = identity
-
+def init_storm_env():
+ global CLUSTER_CONF_DIR
+ ini_file = os.path.join(CLUSTER_CONF_DIR, 'storm_env.ini')
+ if not os.path.isfile(ini_file):
+ return
+ config = ConfigParser.ConfigParser()
+ config.optionxform = str
+ config.read(ini_file)
+ options = config.options('environment')
+ for option in options:
+ value = config.get('environment', option)
+ os.environ[option] = value
+
+normclasspath = cygpath if sys.platform == 'cygwin' else identity
STORM_DIR = "/".join(os.path.realpath( __file__ ).split("/")[:-2])
USER_CONF_DIR = os.path.expanduser("~/.storm")
- CLUSTER_CONF_DIR = STORM_DIR + "/conf"
+ STORM_CONF_DIR = os.getenv('STORM_CONF_DIR', None)
+
+ if STORM_CONF_DIR == None:
+ CLUSTER_CONF_DIR = STORM_DIR + "/conf"
+ else:
+ CLUSTER_CONF_DIR = STORM_CONF_DIR
+
if (not os.path.isfile(USER_CONF_DIR + "/storm.yaml")):
USER_CONF_DIR = CLUSTER_CONF_DIR
+
+init_storm_env()
+
CONFIG_OPTS = []
CONFFILE = ""
JAR_JVM_OPTS = shlex.split(os.getenv('STORM_JAR_JVM_OPTS', ''))