Code0x58 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_r197265429
##########
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:
This is the critical part, as `splitext(path)` returns a 2-tuple. The line
above is just for readability because I was in the area.
----------------------------------------------------------------
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