This is an automated email from the ASF dual-hosted git repository.
lfrolov pushed a commit to branch DLAB-1835
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-1835 by this push:
new 297c782 [DLAB-1835]: simplified hosts resolving for keycloak
297c782 is described below
commit 297c7826cbde33625fdc12742d71a16e55baf891
Author: leonidfrolov <[email protected]>
AuthorDate: Wed May 27 13:51:30 2020 +0300
[DLAB-1835]: simplified hosts resolving for keycloak
---
.../scripts/deploy_keycloak/deploy_keycloak.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git
a/infrastructure-provisioning/scripts/deploy_keycloak/deploy_keycloak.py
b/infrastructure-provisioning/scripts/deploy_keycloak/deploy_keycloak.py
index d9cc06a..3839309 100644
--- a/infrastructure-provisioning/scripts/deploy_keycloak/deploy_keycloak.py
+++ b/infrastructure-provisioning/scripts/deploy_keycloak/deploy_keycloak.py
@@ -47,10 +47,9 @@ def resolving_hosts(os_user):
if not exists('/home/{}/.hosts_resolved'.format(os_user)):
host = sudo('curl
http://169.254.169.254/latest/meta-data/local-hostname')
if 'unable to resolve host' in host:
- host = str(host.replace("\r", " ").replace("\n", " ").split("
")[-1:]).strip("['']")
+ host = host.split('\n')[1]
host_short = host.split('.')[0]
- private_ip = str(sudo('curl
http://169.254.169.254/latest/meta-data/local-ipv4')
- .replace("\r", " ").replace("\n", " ").split("
")[-1:]).strip("['']")
+ private_ip = sudo('curl
http://169.254.169.254/latest/meta-data/local-ipv4').split('\n')[1]
sudo('echo "{} {} {}" >> /etc/hosts'.format(private_ip, host,
host_short))
sudo('touch /home/{}/.hosts_resolved'.format(os_user))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]