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/22 19:00:12 UTC

[GitHub] nwangtw commented on a change in pull request #2933: Fix code when submitting a toplogy file without an known extension

nwangtw commented on a change in pull request #2933: Fix code when submitting a toplogy file without an known extension
URL: https://github.com/apache/incubator-heron/pull/2933#discussion_r197539932
 
 

 ##########
 File path: heron/tools/cli/src/python/submit.py
 ##########
 @@ -424,8 +424,8 @@ def run(command, parser, cl_args, unknown_args):
   tar_type = topology_file.endswith(".tar") or topology_file.endswith(".tar.gz")
   pex_type = topology_file.endswith(".pex")
   cpp_type = topology_file.endswith(".dylib") or topology_file.endswith(".so")
-  if not jar_type and not tar_type and not pex_type and not cpp_type:
-    ext_name = os.path.splitext(topology_file)
+  if not (jar_type or tar_type or pex_type or cpp_type):
+    _, ext_name = os.path.splitext(topology_file)
 
 Review comment:
   Yeah.
   
   I mean why a tuple instead of a string caused the exception. :)

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