This is an automated email from the ASF dual-hosted git repository.

nlu90 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/master by this push:
     new c984bcf  Fix code when submitting a toplogy file without an known 
extension (#2933)
c984bcf is described below

commit c984bcf9b4c5ecd599b54b2ff397c8cbaef79771
Author: Oliver Bristow <[email protected]>
AuthorDate: Fri Jun 22 23:41:56 2018 +0100

    Fix code when submitting a toplogy file without an known extension (#2933)
---
 heron/tools/cli/src/python/submit.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/heron/tools/cli/src/python/submit.py 
b/heron/tools/cli/src/python/submit.py
index 35487c5..e474f6c 100644
--- a/heron/tools/cli/src/python/submit.py
+++ b/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)
     err_context = "Unknown file type '%s'. Please use .tar "\
                   "or .tar.gz or .jar or .pex or .dylib or .so file"\
                   % ext_name

Reply via email to