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

[GitHub] nlu90 commented on a change in pull request #2886: [wip] submit topology file by uri

nlu90 commented on a change in pull request #2886: [wip] submit topology file by uri
URL: https://github.com/apache/incubator-heron/pull/2886#discussion_r185703931
 
 

 ##########
 File path: heron/tools/cli/src/python/submit.py
 ##########
 @@ -366,6 +368,16 @@ def submit_cpp(cl_args, unknown_args, tmp_dir):
 
   return launch_topologies(cl_args, topology_file, tmp_dir)
 
+def download(uri):
+  current_path = os.path.realpath(__file__)
+  print current_path
+  tmp_dir = tempfile.mkdtemp()
+  subprocess.call([current_path + "downloader.sh", uri, tmp_dir])
+  suffix = (".jar", ".tar", ".tar.gz", ".pex", ".dylib", ".so")
+  for f in os.listdir(tmp_dir):
+    if f.endswith(suffix):
 
 Review comment:
   If there are multiple files in this tmp directory, then this `download` method will return the first file it encountered ending with a valid suffix. But is this returned file truly a valid topology file?
   
   If there will be only one file downloaded to this directory, I suggest we remove this `for` loop.

----------------------------------------------------------------
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