You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by bh...@apache.org on 2019/02/21 23:50:53 UTC

[impala] 02/04: IMPALA-8233: Do not re-download Ranger if it is already downloaded

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

bharathv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 01592b5fa374ece9e973585d831f771c46fb5645
Author: Fredy Wijaya <fw...@cloudera.com>
AuthorDate: Wed Feb 20 15:46:09 2019 -0800

    IMPALA-8233: Do not re-download Ranger if it is already downloaded
    
    This patch updates the bootstrap_toolchain.py to not re-download Ranger
    if it is already downloaded.
    
    Testing: Manually tested it by running the boolstrap_toolchain.py.
    
    Change-Id: Iec3b200bda11d00bba6a250461b37c599d8d1adf
    Reviewed-on: http://gerrit.cloudera.org:8080/12541
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 bin/bootstrap_toolchain.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/bootstrap_toolchain.py b/bin/bootstrap_toolchain.py
index 14edfb6..9c2749e 100755
--- a/bin/bootstrap_toolchain.py
+++ b/bin/bootstrap_toolchain.py
@@ -419,10 +419,13 @@ def download_cdh_components(toolchain_root, cdh_components, url_prefix):
 def download_ranger(toolchain_root):
   env_var_version = "IMPALA_RANGER_VERSION"
   version = os.environ.get(env_var_version)
-  file_name = "ranger-{0}-admin.tar.gz".format(version)
+  # If Ranger has already been downloaded, do not re-download it.
   if not version:
     raise Exception("Could not find version for Ranger in environment var {0}"
                     .format(env_var_version))
+  pkg_directory = "{0}/ranger-{1}-admin".format(toolchain_root, version)
+  if os.path.isdir(pkg_directory): return
+  file_name = "ranger-{0}-admin.tar.gz".format(version)
   download_url = "{0}/ranger/{1}/{2}".format(TOOLCHAIN_HOST, version, file_name)
   wget_and_unpack_package(download_url, file_name, toolchain_root, False)