You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by GitBox <gi...@apache.org> on 2018/06/23 18:03:44 UTC

[GitHub] kramasamy commented on a change in pull request #2929: Make TopologyBuilder less permissive

kramasamy commented on a change in pull request #2929: Make TopologyBuilder less permissive
URL: https://github.com/apache/incubator-heron/pull/2929#discussion_r197618933
 
 

 ##########
 File path: heronpy/api/topology.py
 ##########
 @@ -194,24 +194,25 @@ def get_heron_options_from_env():
 
     Currently supports the following options natively:
 
-    - `cmdline.topologydefn.tmpdirectory`: the directory to which this
+    - `cmdline.topologydefn.tmpdirectory`: (required) the directory to which this
     topology's defn file is written
-    - `cmdline.topology.initial.state`: the initial state of the topology
-    - `cmdline.topology.name`: topology name on deployment
+    - `cmdline.topology.initial.state`: (default: "RUNNING") the initial state of the topology
+    - `cmdline.topology.name`: (default: class name) topology name on deployment
 
     Returns: map mapping from key to value
     """
-    heron_options_raw = os.environ.get("HERON_OPTIONS", None)
+    heron_options_raw = os.environ.get("HERON_OPTIONS")
     if heron_options_raw is None:
       raise RuntimeError("HERON_OPTIONS environment variable not found")
 
-    ret = {}
-    heron_opt_list = heron_options_raw.replace("%%%%", " ").split(',')
-    for opt_raw in heron_opt_list:
-      opt = opt_raw.split("=")
-      if len(opt) == 2:
-        ret[opt[0]] = opt[1]
-    return ret
+    options = {}
+    for option_line in heron_options_raw.replace("%%%%", " ").split(','):
 
 Review comment:
   It might be worth trying and if it works - we can use json dumps and load.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services