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

lfrolov pushed a commit to branch DATALAB-2320
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/DATALAB-2320 by this push:
     new 7e61816  [DATALAB-2320]: added wrong creds handling for wget
7e61816 is described below

commit 7e61816d72a90b41553cd03d1ed338d232d90098
Author: leonidfrolov <[email protected]>
AuthorDate: Thu May 20 15:08:59 2021 +0300

    [DATALAB-2320]: added wrong creds handling for wget
---
 .../terraform/bin/deploy/endpoint_fab.py                   |  4 ++--
 .../terraform/gcp/endpoint/provisioning.py                 | 14 ++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py 
b/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py
index 33c5d49..d19639d 100644
--- a/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py
+++ b/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py
@@ -591,7 +591,7 @@ def ensure_jar_endpoint():
                 conn.run('mkdir -p {}'.format(web_path))
             if 'Failed' in conn.run('wget -P {}  --user={} --password={} '
                      'https://{}/repository/packages/provisioning-service-'
-                     '2.4.jar --no-check-certificate2>&1 | tee /tmp/tee.tmp; 
if grep -w -i -E  "ERROR" /tmp/tee.tmp; then echo -e "==============\nFailed 
jar download.\n=============="; fi'
+                     '2.4.jar --no-check-certificate 2>&1 | tee /tmp/tee.tmp; 
if grep -w -i -E  "ERROR" /tmp/tee.tmp; then echo -e "==============\nFailed 
jar download.\n=============="; fi'
                      .format(web_path, args.repository_user,
                              args.repository_pass, 
args.repository_address)).stdout:
                 sys.exit(1)
@@ -599,7 +599,7 @@ def ensure_jar_endpoint():
                      .format(web_path))
             if 'Failed' in conn.run('wget -P {}  --user={} --password={} '
                      'https://{}/repository/packages/billing-{}-'
-                     '2.4.jar --no-check-certificate2>&1 | tee /tmp/tee.tmp; 
if grep -w -i -E  "ERROR" /tmp/tee.tmp; then echo -e "==============\nFailed 
jar download.\n=============="; fi'
+                     '2.4.jar --no-check-certificate 2>&1 | tee /tmp/tee.tmp; 
if grep -w -i -E  "ERROR" /tmp/tee.tmp; then echo -e "==============\nFailed 
jar download.\n=============="; fi'
                      .format(web_path, args.repository_user,
                              args.repository_pass, args.repository_address, 
args.cloud_provider)).stdout:
                 sys.exit(1)
diff --git a/infrastructure-provisioning/terraform/gcp/endpoint/provisioning.py 
b/infrastructure-provisioning/terraform/gcp/endpoint/provisioning.py
index a5aade3..2ec669d 100644
--- a/infrastructure-provisioning/terraform/gcp/endpoint/provisioning.py
+++ b/infrastructure-provisioning/terraform/gcp/endpoint/provisioning.py
@@ -342,17 +342,19 @@ def ensure_jar_endpoint():
             if not exists(conn, web_path):
                 conn.run('mkdir -p {}'.format(web_path))
             if args.cloud_provider == "aws":
-                conn.run('wget -P {}  --user={} --password={} '
+                if 'Failed' in conn.run('wget -P {}  --user={} --password={} '
                          
'https://{}/repository/packages/aws/provisioning-service-'
-                         '2.1.jar --no-check-certificate'
+                         '2.1.jar --no-check-certificate 2>&1 | tee 
/tmp/tee.tmp; if grep -w -i -E  "ERROR" /tmp/tee.tmp; then echo -e 
"==============\nFailed jar download.\n=============="; fi'
                          .format(web_path, args.repository_user,
-                                 args.repository_pass, 
args.repository_address))
+                                 args.repository_pass, 
args.repository_address)).stdout:
+                    sys.exit(1)
             elif args.cloud_provider == "gcp":
-                conn.run('wget -P {}  --user={} --password={} '
+                if 'Failed' in conn.run('wget -P {}  --user={} --password={} '
                          
'https://{}/repository/packages/gcp/provisioning-service-'
-                         '2.1.jar --no-check-certificate'
+                         '2.1.jar --no-check-certificate 2>&1 | tee 
/tmp/tee.tmp; if grep -w -i -E  "ERROR" /tmp/tee.tmp; then echo -e 
"==============\nFailed jar download.\n=============="; fi'
                          .format(web_path, args.repository_user,
-                                 args.repository_pass, 
args.repository_address))
+                                 args.repository_pass, 
args.repository_address)).stdout:
+                    sys.exit(1)
             conn.run('mv {0}/*.jar {0}/provisioning-service.jar'
                      .format(web_path))
             conn.sudo('touch {}'.format(ensure_file))

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to