You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2021/02/17 10:53:22 UTC
[incubator-datalab] branch DATALAB-2091 updated: [DATALAB-2091]:
changed how conn is defined
This is an automated email from the ASF dual-hosted git repository.
lfrolov pushed a commit to branch DATALAB-2091
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/DATALAB-2091 by this push:
new 1f4e30e [DATALAB-2091]: changed how conn is defined
1f4e30e is described below
commit 1f4e30ecefa51814e8c774ae053776f3854a60f5
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Feb 17 12:53:09 2021 +0200
[DATALAB-2091]: changed how conn is defined
---
infrastructure-provisioning/src/base/scripts/create_ssh_user.py | 3 ++-
infrastructure-provisioning/src/general/lib/os/fab.py | 1 -
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/infrastructure-provisioning/src/base/scripts/create_ssh_user.py b/infrastructure-provisioning/src/base/scripts/create_ssh_user.py
index c2569b0..31162bb 100644
--- a/infrastructure-provisioning/src/base/scripts/create_ssh_user.py
+++ b/infrastructure-provisioning/src/base/scripts/create_ssh_user.py
@@ -54,10 +54,11 @@ def ensure_ssh_user(initial_user, os_user, sudo_group, conn):
if __name__ == "__main__":
print("Configure connections")
+ global conn
conn = datalab.fab.init_datalab_connection(args.hostname, args.initial_user, args.keyfile)
print("Creating ssh user: {}".format(args.os_user))
try:
- ensure_ssh_user(args.initial_user, args.os_user, args.sudo_group, conn)
+ ensure_ssh_user(args.initial_user, args.os_user, args.sudo_group)
except Exception as err:
print('Failed to create ssh user', str(err))
sys.exit(1)
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index aa78a84..1dbb66d 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -1010,7 +1010,6 @@ def close_connection():
def init_datalab_connection(hostname, username, keyfile):
try:
- global conn
attempt = 0
while attempt < 10:
print('connection attempt {}'.format(attempt))
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org