kishorvpatil commented on a change in pull request #2930: STORM-3274: Migrates 
storm CLI to using argparse making documentation…
URL: https://github.com/apache/storm/pull/2930#discussion_r253941770
 
 

 ##########
 File path: bin/storm.py
 ##########
 @@ -234,60 +228,21 @@ def resolve_dependencies(artifacts, 
artifact_repositories, maven_local_repos_dir
     except:
         raise RuntimeError("dependency handler returns non-json response: 
sysout<%s>", output)
 
-def print_localconfvalue(name):
-    """Syntax: [storm localconfvalue conf-name]
-
-    Prints out the value for conf-name in the local Storm configs.
-    The local Storm configs are the ones in ~/.storm/storm.yaml merged
-    in with the configs in defaults.yaml.
-    """
-    print(name + ": " + confvalue(name, [USER_CONF_DIR]))
-
-def print_remoteconfvalue(name):
-    """Syntax: [storm remoteconfvalue conf-name]
 
-    Prints out the value for conf-name in the cluster's Storm configs.
-    The cluster's Storm configs are the ones in $STORM-PATH/conf/storm.yaml
-    merged in with the configs in defaults.yaml.
-
-    This command must be run on a cluster machine.
-    """
-    print(name + ": " + confvalue(name, [CLUSTER_CONF_DIR]))
-
-def parse_args(string):
-    """Takes a string of whitespace-separated tokens and parses it into a list.
-    Whitespace inside tokens may be quoted with single quotes, double quotes or
-    backslash (similar to command-line arguments in bash).
-
-    >>> parse_args(r'''"a a" 'b b' c\ c "d'd" 'e"e' 'f\'f' "g\"g" "i""i" 
'j''j' k" "k l' l' mm n\\n''')
-    ['a a', 'b b', 'c c', "d'd", 'e"e', "f'f", 'g"g', 'ii', 'jj', 'k k', 'l 
l', 'mm', r'n\n']
-    """
-    re_split = re.compile(r'''((?:
-        [^\s"'\\] |
-        "(?: [^"\\] | \\.)*" |
-        '(?: [^'\\] | \\.)*' |
-        \\.
-    )+)''', re.VERBOSE)
-    args = re_split.split(string)[1::2]
-    args = [re.compile(r'"((?:[^"\\]|\\.)*)"').sub('\\1', x) for x in args]
-    args = [re.compile(r"'((?:[^'\\]|\\.)*)'").sub('\\1', x) for x in args]
-    return [re.compile(r'\\(.)').sub('\\1', x) for x in args]
-
-def exec_storm_class(klass, jvmtype="-server", jvmopts=[], extrajars=[], 
args=[], fork=False, daemon=True, client=False, daemonName=""):
-    global CONFFILE
-    storm_log_dir = confvalue("storm.log.dir",[CLUSTER_CONF_DIR])
+def exec_storm_class(klass, storm_config_opts, jvmtype="-server", jvmopts=[], 
extrajars=[], args=[], fork=False, daemon=True, client=False, daemonName=""):
+    storm_log_dir = confvalue("storm.log.dir", 
storm_config_opts=storm_config_opts, extrapaths=[CLUSTER_CONF_DIR])
     if(storm_log_dir == None or storm_log_dir == "null"):
         storm_log_dir = os.path.join(STORM_DIR, "logs")
     all_args = [
-        JAVA_CMD, jvmtype,
-        "-Ddaemon.name=" + daemonName,
-        get_config_opts(),
-        "-Dstorm.home=" + STORM_DIR,
-        "-Dstorm.log.dir=" + storm_log_dir,
-        "-Djava.library.path=" + confvalue("java.library.path", extrajars, 
daemon),
-        "-Dstorm.conf.file=" + CONFFILE,
-        "-cp", get_classpath(extrajars, daemon, client=client),
-    ] + jvmopts + [klass] + list(args)
+                   JAVA_CMD, jvmtype,
+                   "-Ddaemon.name=" + daemonName,
+                   get_config_opts(storm_config_opts),
+                   "-Dstorm.home=" + STORM_DIR,
+                   "-Dstorm.log.dir=" + storm_log_dir,
+                   "-Djava.library.path=" + confvalue("java.library.path", 
storm_config_opts, extrajars, daemon=daemon),
+                   "-Dstorm.conf.file=" + CONF_FILE,
+                   "-cp", get_classpath(extrajars, daemon, client=client),
+                   ] + jvmopts + [klass] + list(args)
 
 Review comment:
   It this tabulation extra? Minor..

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to