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 11:23:29 UTC

[incubator-datalab] 01/02: [DATALAB-2091]: changed connection close

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

commit aa93ce155f2742362d5d4ddc729b732c792558a2
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Feb 17 13:21:29 2021 +0200

    [DATALAB-2091]: changed connection close
---
 .../scripts/deploy_repository/deploy_repository.py          |  2 +-
 .../src/base/scripts/install_prerequisites.py               |  2 +-
 .../src/base/scripts/install_user_key.py                    |  2 +-
 .../src/dataengine/scripts/configure_dataengine.py          |  2 +-
 .../deeplearning/scripts/configure_deep_learning_node.py    |  2 +-
 .../src/edge/scripts/configure_http_proxy.py                |  2 +-
 .../src/edge/scripts/configure_nginx_reverse_proxy.py       |  2 +-
 .../src/general/lib/azure/actions_lib.py                    |  4 ++--
 infrastructure-provisioning/src/general/lib/os/fab.py       | 13 +++++--------
 .../src/general/scripts/aws/common_download_git_certfile.py |  2 +-
 .../src/general/scripts/aws/common_remove_remote_kernels.py |  2 +-
 .../src/general/scripts/aws/dataengine-service_configure.py |  2 +-
 .../general/scripts/azure/common_download_git_certfile.py   |  2 +-
 .../general/scripts/azure/common_remove_remote_kernels.py   |  2 +-
 .../src/general/scripts/azure/rstudio_change_pass.py        |  2 +-
 .../src/general/scripts/gcp/common_download_git_certfile.py |  2 +-
 .../src/general/scripts/os/check_inactivity.py              |  2 +-
 .../src/general/scripts/os/common_clean_instance.py         |  2 +-
 .../src/general/scripts/os/common_configure_proxy.py        |  2 +-
 .../general/scripts/os/common_configure_reverse_proxy.py    |  2 +-
 .../src/general/scripts/os/common_configure_spark.py        |  2 +-
 .../src/general/scripts/os/configure_proxy_for_docker.py    |  2 +-
 .../src/general/scripts/os/get_list_available_pkgs.py       |  2 +-
 .../src/general/scripts/os/install_additional_libs.py       |  2 +-
 .../src/general/scripts/os/jupyterlab_container_start.py    |  2 +-
 .../src/general/scripts/os/manage_git_creds.py              |  2 +-
 .../src/general/scripts/os/reconfigure_spark.py             |  2 +-
 .../src/general/scripts/os/superset_start.py                |  2 +-
 .../src/general/scripts/os/update_inactivity_on_start.py    |  2 +-
 .../src/jupyter/scripts/configure_jupyter_node.py           |  2 +-
 .../src/jupyterlab/scripts/configure_jupyterlab_node.py     |  2 +-
 .../src/project/scripts/configure_http_proxy.py             |  2 +-
 .../src/project/scripts/configure_nftables.py               |  2 +-
 .../src/project/scripts/configure_nginx_reverse_proxy.py    |  2 +-
 .../src/rstudio/scripts/configure_rstudio_node.py           |  2 +-
 .../src/ssn/scripts/configure_docker.py                     |  2 +-
 .../src/ssn/scripts/configure_gitlab.py                     |  4 ++--
 .../src/ssn/scripts/configure_ssn_node.py                   |  2 +-
 infrastructure-provisioning/src/ssn/scripts/configure_ui.py |  2 +-
 .../src/ssn/scripts/upload_response_file.py                 |  2 +-
 .../src/superset/scripts/configure_superset_node.py         |  2 +-
 .../tensor-rstudio/scripts/configure_tensor-rstudio_node.py |  2 +-
 .../src/tensor/scripts/configure_tensor_node.py             |  2 +-
 .../src/zeppelin/scripts/configure_zeppelin_node.py         |  2 +-
 44 files changed, 50 insertions(+), 53 deletions(-)

diff --git a/infrastructure-provisioning/scripts/deploy_repository/deploy_repository.py b/infrastructure-provisioning/scripts/deploy_repository/deploy_repository.py
index d32c28b..2200a09 100644
--- a/infrastructure-provisioning/scripts/deploy_repository/deploy_repository.py
+++ b/infrastructure-provisioning/scripts/deploy_repository/deploy_repository.py
@@ -1782,6 +1782,6 @@ if __name__ == "__main__":
                 remove_route_tables()
                 remove_vpc(args.vpc_id)
             sys.exit(1)
-        datalab.fab.close_connection()
+        conn.close()
     else:
         print('Invalid action: {}'.format(args.action))
diff --git a/infrastructure-provisioning/src/base/scripts/install_prerequisites.py b/infrastructure-provisioning/src/base/scripts/install_prerequisites.py
index dd14b22..e5199c6 100644
--- a/infrastructure-provisioning/src/base/scripts/install_prerequisites.py
+++ b/infrastructure-provisioning/src/base/scripts/install_prerequisites.py
@@ -73,4 +73,4 @@ if __name__ == "__main__":
     print("Installing NTPd")
     ensure_ntpd(args.user, args.edge_private_ip)
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/base/scripts/install_user_key.py b/infrastructure-provisioning/src/base/scripts/install_user_key.py
index f0ba0d9..0af8489 100644
--- a/infrastructure-provisioning/src/base/scripts/install_user_key.py
+++ b/infrastructure-provisioning/src/base/scripts/install_user_key.py
@@ -72,7 +72,7 @@ if __name__ == "__main__":
     print("Installing users key...")
     try:
         copy_key(deeper_config)
-        datalab.fab.close_connection()
+        conn.close()
     except:
         print("Users keyfile {0} could not be found at {1}/{0}".format(args.keyfile, deeper_config['user_keydir']))
         sys.exit(1)
diff --git a/infrastructure-provisioning/src/dataengine/scripts/configure_dataengine.py b/infrastructure-provisioning/src/dataengine/scripts/configure_dataengine.py
index 2329386..a53aa74 100644
--- a/infrastructure-provisioning/src/dataengine/scripts/configure_dataengine.py
+++ b/infrastructure-provisioning/src/dataengine/scripts/configure_dataengine.py
@@ -218,4 +218,4 @@ if __name__ == "__main__":
         conn.sudo('systemctl start livy.service')
         conn.sudo('touch /home/{0}/.ensure_dir/livy_ensured'.format(args.os_user))
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/deeplearning/scripts/configure_deep_learning_node.py b/infrastructure-provisioning/src/deeplearning/scripts/configure_deep_learning_node.py
index 2d4dacf..c9d9927 100644
--- a/infrastructure-provisioning/src/deeplearning/scripts/configure_deep_learning_node.py
+++ b/infrastructure-provisioning/src/deeplearning/scripts/configure_deep_learning_node.py
@@ -172,4 +172,4 @@ if __name__ == "__main__":
     print("Updating pyOpenSSL library")
     update_pyopenssl_lib(args.os_user)
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/edge/scripts/configure_http_proxy.py b/infrastructure-provisioning/src/edge/scripts/configure_http_proxy.py
index e48b39f..e75291b 100644
--- a/infrastructure-provisioning/src/edge/scripts/configure_http_proxy.py
+++ b/infrastructure-provisioning/src/edge/scripts/configure_http_proxy.py
@@ -48,4 +48,4 @@ if __name__ == "__main__":
 
     print("Installing proxy for notebooks.")
     configure_http_proxy_server(deeper_config)
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/edge/scripts/configure_nginx_reverse_proxy.py b/infrastructure-provisioning/src/edge/scripts/configure_nginx_reverse_proxy.py
index f464ce2..862d98a 100644
--- a/infrastructure-provisioning/src/edge/scripts/configure_nginx_reverse_proxy.py
+++ b/infrastructure-provisioning/src/edge/scripts/configure_nginx_reverse_proxy.py
@@ -59,4 +59,4 @@ if __name__ == "__main__":
     except Exception as err:
         print("Failed install nginx reverse proxy: " + str(err))
         sys.exit(1)
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/general/lib/azure/actions_lib.py b/infrastructure-provisioning/src/general/lib/azure/actions_lib.py
index 16b3031..c128427 100644
--- a/infrastructure-provisioning/src/general/lib/azure/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/azure/actions_lib.py
@@ -1227,7 +1227,7 @@ def remount_azure_disk(creds=False, os_user='', hostname='', keyfile=''):
     conn.sudo('grep "azure_resource-part1" /etc/fstab > /dev/null &&  umount -f /mnt/ || true')
     conn.sudo('mount -a')
     if creds:
-        datalab.fab.close_connection()
+        conn.close()
 
 
 def prepare_vm_for_image(creds=False, os_user='', hostname='', keyfile=''):
@@ -1235,7 +1235,7 @@ def prepare_vm_for_image(creds=False, os_user='', hostname='', keyfile=''):
         conn = datalab.fab.init_datalab_connection(hostname, os_user, keyfile)
     conn.sudo('waagent -deprovision -force')
     if creds:
-        datalab.fab.close_connection()
+        conn.close()
 
 
 def prepare_disk(os_user):
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index 42fc6e5..d14de45 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -186,7 +186,7 @@ def put_resource_status(resource, status, datalab_path, os_user, hostname):
     keyfile = os.environ['conf_key_dir'] + os.environ['conf_key_name'] + ".pem"
     init_datalab_connection(hostname, os_user, keyfile)
     conn.sudo('python3 ' + datalab_path + 'tmp/resource_status.py --resource {} --status {}'.format(resource, status))
-    close_connection()
+    conn.close()
 
 
 def configure_jupyter(os_user, jupyter_conf_file, templates_dir, jupyter_version, exploratory_name):
@@ -676,7 +676,7 @@ def set_git_proxy(os_user, hostname, keyfile, proxy_host):
     init_datalab_connection(hostname, os_user, keyfile)
     conn.run('git config --global http.proxy {}'.format(proxy_host))
     conn.run('git config --global https.proxy {}'.format(proxy_host))
-    close_connection()
+    conn.close()
 
 
 def set_mongo_parameters(client, mongo_parameters):
@@ -742,7 +742,7 @@ def configure_data_engine_service_pip(hostname, os_user, keyfile, emr=False):
     conn.sudo('echo "export PATH=$PATH:/usr/local/bin" >> /etc/profile')
     conn.sudo('source /etc/profile')
     conn.run('source /etc/profile')
-    close_connection()
+    conn.close()
 
 
 def remove_rstudio_dataengines_kernel(cluster_name, os_user):
@@ -800,7 +800,7 @@ def restart_zeppelin(creds=False, os_user='', hostname='', keyfile=''):
     conn.sudo("systemctl daemon-reload")
     conn.sudo("systemctl restart zeppelin-notebook")
     if creds:
-        close_connection()
+        conn.close()
 
 def get_spark_memory(creds=False, os_user='', hostname='', keyfile=''):
     if creds:
@@ -912,7 +912,7 @@ def update_zeppelin_interpreters(multiple_clusters, r_enabled, interpreter_mode=
         sys.exit(1)
 
 
-def update_hosts_file(os_user, conn):
+def update_hosts_file(os_user):
     try:
         if not exists(conn,'/home/{}/.ensure_dir/hosts_file_updated'.format(os_user)):
             conn.sudo('sed -i "s/^127.0.0.1 localhost/127.0.0.1 localhost localhost.localdomain/g" /etc/hosts')
@@ -1004,9 +1004,6 @@ def manage_npm_pkg(command):
     except:
         sys.exit(1)
 
-def close_connection():
-    conn.close()
-
 def init_datalab_connection(hostname, username, keyfile):
     try:
         attempt = 0
diff --git a/infrastructure-provisioning/src/general/scripts/aws/common_download_git_certfile.py b/infrastructure-provisioning/src/general/scripts/aws/common_download_git_certfile.py
index dfcff67..296ee16 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/common_download_git_certfile.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/common_download_git_certfile.py
@@ -50,4 +50,4 @@ if __name__ == "__main__":
     else:
         print('There is no {} to download'.format(gitlab_certfile))
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/general/scripts/aws/common_remove_remote_kernels.py b/infrastructure-provisioning/src/general/scripts/aws/common_remove_remote_kernels.py
index 9a5eed2..33e523b 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/common_remove_remote_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/common_remove_remote_kernels.py
@@ -50,5 +50,5 @@ if __name__ == "__main__":
     except Exception as err:
         print('Failed to remove cluster kernels.', str(err))
         sys.exit(1)
-    datalab.fab.close_connection()
+    conn.close()
     sys.exit(0)
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py b/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py
index 45b0d28..5cf15a7 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py
@@ -86,7 +86,7 @@ def configure_dataengine_service(instance, emr_conf):
             conn.sudo('echo "[main]" > /etc/yum/pluginconf.d/priorities.conf ; echo "enabled = 0" >> '
                  '/etc/yum/pluginconf.d/priorities.conf')
             manage_pkg('-y install', 'remote', 'R-devel')
-            datalab.fab.close_connection()
+            conn.close()
         except:
             traceback.print_exc()
             raise Exception
diff --git a/infrastructure-provisioning/src/general/scripts/azure/common_download_git_certfile.py b/infrastructure-provisioning/src/general/scripts/azure/common_download_git_certfile.py
index 8841217..c7bb501 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/common_download_git_certfile.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/common_download_git_certfile.py
@@ -52,4 +52,4 @@ if __name__ == "__main__":
     else:
         print('There is no {} to download'.format(gitlab_certfile))
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/azure/common_remove_remote_kernels.py b/infrastructure-provisioning/src/general/scripts/azure/common_remove_remote_kernels.py
index 6e91b95..79120da 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/common_remove_remote_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/common_remove_remote_kernels.py
@@ -48,4 +48,4 @@ if __name__ == "__main__":
     except Exception as err:
         print('Failed to remove cluster kernels.', str(err))
         sys.exit(1)
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/general/scripts/azure/rstudio_change_pass.py b/infrastructure-provisioning/src/general/scripts/azure/rstudio_change_pass.py
index a9cd20f..01242af 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/rstudio_change_pass.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/rstudio_change_pass.py
@@ -40,7 +40,7 @@ if __name__ == "__main__":
     print("Setting password for Rstudio user.")
     try:
         conn.sudo('echo "{0}:{1}" | chpasswd'.format(args.os_user, args.rstudio_pass))
-        datalab.fab.close_connection()
+        conn.close()
     except Exception as err:
         print('Error: {0}'.format(err))
         sys.exit(1)
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/common_download_git_certfile.py b/infrastructure-provisioning/src/general/scripts/gcp/common_download_git_certfile.py
index f1b5f16..893e61e 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/common_download_git_certfile.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/common_download_git_certfile.py
@@ -45,4 +45,4 @@ if __name__ == "__main__":
     else:
         print('There is no {} to download'.format(gitlab_certfile))
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/os/check_inactivity.py b/infrastructure-provisioning/src/general/scripts/os/check_inactivity.py
index 012c433..0e36bf0 100644
--- a/infrastructure-provisioning/src/general/scripts/os/check_inactivity.py
+++ b/infrastructure-provisioning/src/general/scripts/os/check_inactivity.py
@@ -56,4 +56,4 @@ if __name__ == "__main__":
     with open('/root/result.json', 'w') as outfile:
         json.dump(timestamp, outfile)
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/general/scripts/os/common_clean_instance.py b/infrastructure-provisioning/src/general/scripts/os/common_clean_instance.py
index eda8a82..35c49bd 100644
--- a/infrastructure-provisioning/src/general/scripts/os/common_clean_instance.py
+++ b/infrastructure-provisioning/src/general/scripts/os/common_clean_instance.py
@@ -153,5 +153,5 @@ if __name__ == "__main__":
                 clean_tensor_rstudio()
     else:
         print('Found default ami, do not make clean')
-    datalab.fab.close_connection()
+    conn.close()
     sys.exit(0)
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/os/common_configure_proxy.py b/infrastructure-provisioning/src/general/scripts/os/common_configure_proxy.py
index d122467..5f2a56a 100644
--- a/infrastructure-provisioning/src/general/scripts/os/common_configure_proxy.py
+++ b/infrastructure-provisioning/src/general/scripts/os/common_configure_proxy.py
@@ -46,4 +46,4 @@ if __name__ == "__main__":
     print("Enabling proxy for notebook server for repositories access.")
     enable_proxy(deeper_config['proxy_host'], deeper_config['proxy_port'])
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/general/scripts/os/common_configure_reverse_proxy.py b/infrastructure-provisioning/src/general/scripts/os/common_configure_reverse_proxy.py
index ce35b03..ef70848 100644
--- a/infrastructure-provisioning/src/general/scripts/os/common_configure_reverse_proxy.py
+++ b/infrastructure-provisioning/src/general/scripts/os/common_configure_reverse_proxy.py
@@ -107,5 +107,5 @@ if __name__ == "__main__":
     conn.put('/tmp/{}.conf'.format(conf_file_name), '/usr/local/openresty/nginx/conf/locations', use_sudo=True)
     conn.sudo('service openresty reload')
 
-    datalab.fab.close_connection()
+    conn.close()
 
diff --git a/infrastructure-provisioning/src/general/scripts/os/common_configure_spark.py b/infrastructure-provisioning/src/general/scripts/os/common_configure_spark.py
index 7e8b1d3..147a0c0 100644
--- a/infrastructure-provisioning/src/general/scripts/os/common_configure_spark.py
+++ b/infrastructure-provisioning/src/general/scripts/os/common_configure_spark.py
@@ -92,4 +92,4 @@ if __name__ == "__main__":
     if 'spark_configurations' in os.environ:
         add_custom_spark_properties(args.cluster_name)
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/os/configure_proxy_for_docker.py b/infrastructure-provisioning/src/general/scripts/os/configure_proxy_for_docker.py
index b2f1e53..91d83af 100644
--- a/infrastructure-provisioning/src/general/scripts/os/configure_proxy_for_docker.py
+++ b/infrastructure-provisioning/src/general/scripts/os/configure_proxy_for_docker.py
@@ -55,4 +55,4 @@ if __name__ == "__main__":
     except Exception as err:
         print('Error: {0}'.format(err))
         sys.exit(1)
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/os/get_list_available_pkgs.py b/infrastructure-provisioning/src/general/scripts/os/get_list_available_pkgs.py
index ac87479..dd88742 100644
--- a/infrastructure-provisioning/src/general/scripts/os/get_list_available_pkgs.py
+++ b/infrastructure-provisioning/src/general/scripts/os/get_list_available_pkgs.py
@@ -100,4 +100,4 @@ if __name__ == "__main__":
     with open("/root/all_pkgs.json", 'w') as result:
         result.write(json.dumps(all_pkgs))
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/general/scripts/os/install_additional_libs.py b/infrastructure-provisioning/src/general/scripts/os/install_additional_libs.py
index 3091202..ba5dcd4 100644
--- a/infrastructure-provisioning/src/general/scripts/os/install_additional_libs.py
+++ b/infrastructure-provisioning/src/general/scripts/os/install_additional_libs.py
@@ -113,7 +113,7 @@ if __name__ == "__main__":
             general_status = general_status + status
         except KeyError:
             pass
-    datalab.fab.close_connection()
+    conn.close()
     with open("/root/result.json", 'w') as result:
         res = {"Action": "Install additional libs",
                "Libs": general_status}
diff --git a/infrastructure-provisioning/src/general/scripts/os/jupyterlab_container_start.py b/infrastructure-provisioning/src/general/scripts/os/jupyterlab_container_start.py
index e2dd16e..43b6e82 100644
--- a/infrastructure-provisioning/src/general/scripts/os/jupyterlab_container_start.py
+++ b/infrastructure-provisioning/src/general/scripts/os/jupyterlab_container_start.py
@@ -57,4 +57,4 @@ if __name__ == "__main__":
     except Exception as err:
         print('Error: {0}'.format(err))
         sys.exit(1)
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/general/scripts/os/manage_git_creds.py b/infrastructure-provisioning/src/general/scripts/os/manage_git_creds.py
index 6938265..47cd654 100644
--- a/infrastructure-provisioning/src/general/scripts/os/manage_git_creds.py
+++ b/infrastructure-provisioning/src/general/scripts/os/manage_git_creds.py
@@ -86,4 +86,4 @@ if __name__ == "__main__":
         append_result("Failed to add host/login/(password/token) to config.", str(err))
         sys.exit(1)
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/os/reconfigure_spark.py b/infrastructure-provisioning/src/general/scripts/os/reconfigure_spark.py
index 63079f6..0d9b5fe 100644
--- a/infrastructure-provisioning/src/general/scripts/os/reconfigure_spark.py
+++ b/infrastructure-provisioning/src/general/scripts/os/reconfigure_spark.py
@@ -68,4 +68,4 @@ if __name__ == "__main__":
         conn.sudo('/usr/bin/python3 /usr/local/bin/notebook_reconfigure_dataengine_spark.py --cluster_name {0} '
              '--jars_dir {1} --cluster_dir {2} --datalake_enabled {3} --spark_configurations "{4}"'.format(
               args.cluster_name, jars_dir, cluster_dir, datalake_enabled, os.environ['spark_configurations']))
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/os/superset_start.py b/infrastructure-provisioning/src/general/scripts/os/superset_start.py
index c32614c..d3bd287 100644
--- a/infrastructure-provisioning/src/general/scripts/os/superset_start.py
+++ b/infrastructure-provisioning/src/general/scripts/os/superset_start.py
@@ -57,4 +57,4 @@ if __name__ == "__main__":
         print('Error: {0}'.format(err))
         sys.exit(1)
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/general/scripts/os/update_inactivity_on_start.py b/infrastructure-provisioning/src/general/scripts/os/update_inactivity_on_start.py
index 490492e..bd2f4ea 100644
--- a/infrastructure-provisioning/src/general/scripts/os/update_inactivity_on_start.py
+++ b/infrastructure-provisioning/src/general/scripts/os/update_inactivity_on_start.py
@@ -45,4 +45,4 @@ if __name__ == "__main__":
 
     conn.sudo("date +%s > /opt/inactivity/{}_inactivity".format(kernel))
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/jupyter/scripts/configure_jupyter_node.py b/infrastructure-provisioning/src/jupyter/scripts/configure_jupyter_node.py
index 18e3053..3f4ca72 100644
--- a/infrastructure-provisioning/src/jupyter/scripts/configure_jupyter_node.py
+++ b/infrastructure-provisioning/src/jupyter/scripts/configure_jupyter_node.py
@@ -145,4 +145,4 @@ if __name__ == "__main__":
     print("Updating pyOpenSSL library")
     update_pyopenssl_lib(args.os_user)
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py b/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py
index b649181..187af8f 100644
--- a/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py
+++ b/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py
@@ -112,4 +112,4 @@ if __name__ == "__main__":
     print("Install inactivity checker")
     install_inactivity_checker(args.os_user, args.ip_address)
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/project/scripts/configure_http_proxy.py b/infrastructure-provisioning/src/project/scripts/configure_http_proxy.py
index 295c77a..818f503 100644
--- a/infrastructure-provisioning/src/project/scripts/configure_http_proxy.py
+++ b/infrastructure-provisioning/src/project/scripts/configure_http_proxy.py
@@ -48,4 +48,4 @@ if __name__ == "__main__":
     print("Installing proxy for notebooks.")
     configure_http_proxy_server(deeper_config)
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/project/scripts/configure_nftables.py b/infrastructure-provisioning/src/project/scripts/configure_nftables.py
index cd4e35f..265373d 100644
--- a/infrastructure-provisioning/src/project/scripts/configure_nftables.py
+++ b/infrastructure-provisioning/src/project/scripts/configure_nftables.py
@@ -47,4 +47,4 @@ if __name__ == "__main__":
 
     print("Configuring nftables on edge node.")
     configure_nftables(deeper_config)
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/project/scripts/configure_nginx_reverse_proxy.py b/infrastructure-provisioning/src/project/scripts/configure_nginx_reverse_proxy.py
index bf4ab58..146a5e2 100644
--- a/infrastructure-provisioning/src/project/scripts/configure_nginx_reverse_proxy.py
+++ b/infrastructure-provisioning/src/project/scripts/configure_nginx_reverse_proxy.py
@@ -69,4 +69,4 @@ if __name__ == "__main__":
         print("Failed install nginx reverse proxy: " + str(err))
         sys.exit(1)
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py b/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py
index dd11c19..11d54f4 100644
--- a/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py
+++ b/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py
@@ -114,4 +114,4 @@ if __name__ == "__main__":
     print("Updating pyOpenSSL library")
     update_pyopenssl_lib(args.os_user)
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
index c4fe770..4e86b4e 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
@@ -221,5 +221,5 @@ if __name__ == "__main__":
     if not configure_guacamole():
         sys.exit(1)
 
-    datalab.fab.close_connection()
+    conn.close()
     sys.exit(0)
diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_gitlab.py b/infrastructure-provisioning/src/ssn/scripts/configure_gitlab.py
index d5796f2..b98def3 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_gitlab.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_gitlab.py
@@ -61,7 +61,7 @@ def create_user(os_user):
     except Exception as err:
         print('Failed to install gitlab.{}'.format(str(err)))
         sys.exit(1)
-    datalab.fab.close_connection()
+    conn.close()
 
 def prepare_config():
     try:
@@ -192,4 +192,4 @@ if __name__ == "__main__":
     configure_gitlab()
 
     summary()
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py b/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
index f3ef456..50c9122 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
@@ -281,4 +281,4 @@ if __name__ == "__main__":
     print("Configuring docker_build script")
     docker_build_script()
 
-    datalab.fab.close_connection()
\ No newline at end of file
+    conn.close()
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_ui.py b/infrastructure-provisioning/src/ssn/scripts/configure_ui.py
index cab6f99..317370a 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_ui.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_ui.py
@@ -243,4 +243,4 @@ if __name__ == "__main__":
              args.usage, args.cost, args.resource_id, args.tags, args.billing_dataset_name, args.keycloak_client_id,
              args.keycloak_client_secret, args.keycloak_auth_server_url)
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/ssn/scripts/upload_response_file.py b/infrastructure-provisioning/src/ssn/scripts/upload_response_file.py
index 53d322c..261832e 100644
--- a/infrastructure-provisioning/src/ssn/scripts/upload_response_file.py
+++ b/infrastructure-provisioning/src/ssn/scripts/upload_response_file.py
@@ -45,7 +45,7 @@ def upload_response_file(instance_name, local_log_filepath, os_user):
                                                         os.environ['ssn_datalab_path']))
         conn.put(local_log_filepath, '/home/{}/ssn.log'.format(os_user))
         conn.sudo('mv /home/{}/ssn.log /var/opt/datalab/log/ssn/'.format(os_user))
-        datalab.fab.close_connection()
+        conn.close()
         return True
     except:
         print('Failed to upload response file')
diff --git a/infrastructure-provisioning/src/superset/scripts/configure_superset_node.py b/infrastructure-provisioning/src/superset/scripts/configure_superset_node.py
index 3f21f4f..356f33d 100644
--- a/infrastructure-provisioning/src/superset/scripts/configure_superset_node.py
+++ b/infrastructure-provisioning/src/superset/scripts/configure_superset_node.py
@@ -86,6 +86,6 @@ if __name__ == "__main__":
                            args.keycloak_client_id, args.keycloak_client_secret, args.edge_instance_private_ip, args.edge_instance_public_ip, args.superset_name)
     except:
         sys.exit(1)
-    datalab.fab.close_connection()
+    conn.close()
 
 
diff --git a/infrastructure-provisioning/src/tensor-rstudio/scripts/configure_tensor-rstudio_node.py b/infrastructure-provisioning/src/tensor-rstudio/scripts/configure_tensor-rstudio_node.py
index 1211bb9..33fa3d4 100644
--- a/infrastructure-provisioning/src/tensor-rstudio/scripts/configure_tensor-rstudio_node.py
+++ b/infrastructure-provisioning/src/tensor-rstudio/scripts/configure_tensor-rstudio_node.py
@@ -132,4 +132,4 @@ if __name__ == "__main__":
     print("Updating pyOpenSSL library")
     update_pyopenssl_lib(args.os_user)
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py b/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py
index b5d1b89..af005dd 100644
--- a/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py
+++ b/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py
@@ -141,4 +141,4 @@ if __name__ == "__main__":
     print("Updating pyOpenSSL library")
     update_pyopenssl_lib(args.os_user)
 
-    datalab.fab.close_connection()
+    conn.close()
diff --git a/infrastructure-provisioning/src/zeppelin/scripts/configure_zeppelin_node.py b/infrastructure-provisioning/src/zeppelin/scripts/configure_zeppelin_node.py
index 1c90d14..6490c8f 100644
--- a/infrastructure-provisioning/src/zeppelin/scripts/configure_zeppelin_node.py
+++ b/infrastructure-provisioning/src/zeppelin/scripts/configure_zeppelin_node.py
@@ -274,4 +274,4 @@ if __name__ == "__main__":
     print("Updating pyOpenSSL library")
     update_pyopenssl_lib(args.os_user)
 
-    datalab.fab.close_connection()
+    conn.close()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org