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/24 13:07:19 UTC

[incubator-datalab] branch DATALAB-2091 updated: [DATALAB-2091]: fixed exists usage with fabric 2.x

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 59c5578  [DATALAB-2091]: fixed exists usage with fabric 2.x
59c5578 is described below

commit 59c5578b3c5369003b4575e9689ad7e89bb89f50
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Feb 24 15:07:03 2021 +0200

    [DATALAB-2091]: fixed exists usage with fabric 2.x
---
 .../src/deeplearning/scripts/configure_deep_learning_node.py   |  2 +-
 infrastructure-provisioning/src/general/lib/aws/actions_lib.py | 10 +++++-----
 .../src/general/lib/azure/actions_lib.py                       |  6 +++---
 infrastructure-provisioning/src/general/lib/gcp/actions_lib.py | 10 +++++-----
 .../src/general/lib/os/debian/common_lib.py                    |  2 +-
 .../src/general/lib/os/debian/notebook_lib.py                  |  2 +-
 infrastructure-provisioning/src/general/lib/os/fab.py          |  6 +++---
 .../src/general/lib/os/redhat/notebook_lib.py                  |  2 +-
 .../scripts/aws/jupyter_install_dataengine-service_kernels.py  |  2 +-
 .../scripts/aws/rstudio_install_dataengine-service_kernels.py  |  2 +-
 .../scripts/aws/zeppelin_install_dataengine-service_kernels.py |  2 +-
 .../scripts/gcp/jupyter_install_dataengine-service_kernels.py  |  2 +-
 .../scripts/gcp/rstudio_install_dataengine-service_kernels.py  |  2 +-
 .../scripts/gcp/zeppelin_install_dataengine-service_kernels.py |  2 +-
 .../src/general/scripts/os/check_inactivity.py                 |  2 +-
 .../scripts/os/deeplearning_install_dataengine_kernels.py      |  2 +-
 .../general/scripts/os/jupyter_install_dataengine_kernels.py   |  2 +-
 .../src/general/scripts/os/manage_git_creds.py                 |  6 +++---
 .../general/scripts/os/rstudio_install_dataengine_kernels.py   |  2 +-
 .../scripts/os/tensor-rstudio_install_dataengine_kernels.py    |  2 +-
 .../general/scripts/os/tensor_install_dataengine_kernels.py    |  2 +-
 .../general/scripts/os/zeppelin_install_dataengine_kernels.py  |  2 +-
 .../src/jupyter/scripts/configure_jupyter_node.py              |  2 +-
 .../src/jupyterlab/scripts/configure_jupyterlab_node.py        |  2 +-
 .../src/rstudio/scripts/configure_rstudio_node.py              |  2 +-
 infrastructure-provisioning/src/ssn/scripts/configure_ui.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            |  4 ++--
 30 files changed, 45 insertions(+), 45 deletions(-)

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 f84d318..3ac031d 100644
--- a/infrastructure-provisioning/src/deeplearning/scripts/configure_deep_learning_node.py
+++ b/infrastructure-provisioning/src/deeplearning/scripts/configure_deep_learning_node.py
@@ -155,7 +155,7 @@ if __name__ == "__main__":
     install_nodejs(args.os_user)
     print("Install Ungit")
     install_ungit(args.os_user, args.exploratory_name, args.edge_ip)
-    if exists('/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
+    if exists(conn, '/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
         install_gitlab_cert(args.os_user, gitlab_certfile)
 
     # INSTALL INACTIVITY CHECKER
diff --git a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
index fb1bdee..5ca46a1 100644
--- a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
@@ -1261,7 +1261,7 @@ def remove_kernels(emr_name, tag_name, nb_tag_value, ssh_user, key_path, emr_ver
                 env.key_filename = "{}".format(key_path)
                 env.host_string = env.user + "@" + env.hosts
                 conn.sudo('rm -rf /home/{}/.local/share/jupyter/kernels/*_{}'.format(ssh_user, emr_name))
-                if exists('/home/{}/.ensure_dir/dataengine-service_{}_interpreter_ensured'.format(ssh_user, emr_name)):
+                if exists(conn, '/home/{}/.ensure_dir/dataengine-service_{}_interpreter_ensured'.format(ssh_user, emr_name)):
                     if os.environ['notebook_multiple_clusters'] == 'true':
                         try:
                             livy_port = conn.sudo("cat /opt/" + emr_version + "/" + emr_name +
@@ -1304,7 +1304,7 @@ def remove_kernels(emr_name, tag_name, nb_tag_value, ssh_user, key_path, emr_ver
                     conn.sudo('sleep 5')
                     conn.sudo('rm -rf /home/{}/.ensure_dir/dataengine-service_{}_interpreter_ensured'.format(ssh_user,
                                                                                                         emr_name))
-                if exists('/home/{}/.ensure_dir/rstudio_dataengine-service_ensured'.format(ssh_user)):
+                if exists(conn, '/home/{}/.ensure_dir/rstudio_dataengine-service_ensured'.format(ssh_user)):
                     datalab.fab.remove_rstudio_dataengines_kernel(computational_name, ssh_user)
                 conn.sudo('rm -rf  /opt/' + emr_version + '/' + emr_name + '/')
                 print("Notebook's {} kernels were removed".format(env.hosts))
@@ -1641,7 +1641,7 @@ def configure_local_spark(jars_dir, templates_dir, memory_type='driver'):
     try:
         # Checking if spark.jars parameter was generated previously
         spark_jars_paths = None
-        if exists('/opt/spark/conf/spark-defaults.conf'):
+        if exists(conn, '/opt/spark/conf/spark-defaults.conf'):
             try:
                 spark_jars_paths = conn.sudo('cat /opt/spark/conf/spark-defaults.conf | grep -e "^spark.jars " ').stdout
             except:
@@ -1874,7 +1874,7 @@ def remove_dataengine_kernels(tag_name, notebook_name, os_user, key_path, cluste
         env.key_filename = "{}".format(key_path)
         env.host_string = env.user + "@" + env.hosts
         conn.sudo('rm -rf /home/{}/.local/share/jupyter/kernels/*_{}'.format(os_user, cluster_name))
-        if exists('/home/{}/.ensure_dir/dataengine_{}_interpreter_ensured'.format(os_user, cluster_name)):
+        if exists(conn, '/home/{}/.ensure_dir/dataengine_{}_interpreter_ensured'.format(os_user, cluster_name)):
             if os.environ['notebook_multiple_clusters'] == 'true':
                 try:
                     livy_port = conn.sudo("cat /opt/" + cluster_name +
@@ -1915,7 +1915,7 @@ def remove_dataengine_kernels(tag_name, notebook_name, os_user, key_path, cluste
                     zeppelin_restarted = True
             conn.sudo('sleep 5')
             conn.sudo('rm -rf /home/{}/.ensure_dir/dataengine_{}_interpreter_ensured'.format(os_user, cluster_name))
-        if exists('/home/{}/.ensure_dir/rstudio_dataengine_ensured'.format(os_user)):
+        if exists(conn, '/home/{}/.ensure_dir/rstudio_dataengine_ensured'.format(os_user)):
             datalab.fab.remove_rstudio_dataengines_kernel(os.environ['computational_name'], os_user)
         conn.sudo('rm -rf  /opt/' + cluster_name + '/')
         print("Notebook's {} kernels were removed".format(env.hosts))
diff --git a/infrastructure-provisioning/src/general/lib/azure/actions_lib.py b/infrastructure-provisioning/src/general/lib/azure/actions_lib.py
index 031535e..2d568c3 100644
--- a/infrastructure-provisioning/src/general/lib/azure/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/azure/actions_lib.py
@@ -975,7 +975,7 @@ class AzureActions:
             env.key_filename = "{}".format(key_path)
             env.host_string = env.user + "@" + env.hosts
             conn.sudo('rm -rf /home/{}/.local/share/jupyter/kernels/*_{}'.format(os_user, cluster_name))
-            if exists('/home/{}/.ensure_dir/dataengine_{}_interpreter_ensured'.format(os_user, cluster_name)):
+            if exists(conn, '/home/{}/.ensure_dir/dataengine_{}_interpreter_ensured'.format(os_user, cluster_name)):
                 if os.environ['notebook_multiple_clusters'] == 'true':
                     try:
                         livy_port = conn.sudo("cat /opt/" + cluster_name +
@@ -1016,7 +1016,7 @@ class AzureActions:
                         zeppelin_restarted = True
                 conn.sudo('sleep 5')
                 conn.sudo('rm -rf /home/{}/.ensure_dir/dataengine_{}_interpreter_ensured'.format(os_user, cluster_name))
-            if exists('/home/{}/.ensure_dir/rstudio_dataengine_ensured'.format(os_user)):
+            if exists(conn, '/home/{}/.ensure_dir/rstudio_dataengine_ensured'.format(os_user)):
                 datalab.fab.remove_rstudio_dataengines_kernel(os.environ['computational_name'], os_user)
             conn.sudo('rm -rf  /opt/' + cluster_name + '/')
             print("Notebook's {} kernels were removed".format(env.hosts))
@@ -1098,7 +1098,7 @@ def configure_local_spark(jars_dir, templates_dir, memory_type='driver'):
     try:
         # Checking if spark.jars parameter was generated previously
         spark_jars_paths = None
-        if exists('/opt/spark/conf/spark-defaults.conf'):
+        if exists(conn, '/opt/spark/conf/spark-defaults.conf'):
             try:
                 spark_jars_paths = conn.sudo('cat /opt/spark/conf/spark-defaults.conf | grep -e "^spark.jars " ').stdout
             except:
diff --git a/infrastructure-provisioning/src/general/lib/gcp/actions_lib.py b/infrastructure-provisioning/src/general/lib/gcp/actions_lib.py
index d7734b0..b356467 100644
--- a/infrastructure-provisioning/src/general/lib/gcp/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/gcp/actions_lib.py
@@ -1147,7 +1147,7 @@ class GCPActions:
             env.key_filename = "{}".format(key_path)
             env.host_string = env.user + "@" + env.hosts
             conn.sudo('rm -rf /home/{}/.local/share/jupyter/kernels/*_{}'.format(ssh_user, dataproc_name))
-            if exists('/home/{}/.ensure_dir/dataengine-service_{}_interpreter_ensured'.format(ssh_user, dataproc_name)):
+            if exists(conn, '/home/{}/.ensure_dir/dataengine-service_{}_interpreter_ensured'.format(ssh_user, dataproc_name)):
                 if os.environ['notebook_multiple_clusters'] == 'true':
                     try:
                         livy_port = conn.sudo("cat /opt/" + dataproc_version + "/" + dataproc_name
@@ -1185,7 +1185,7 @@ class GCPActions:
                         zeppelin_restarted = True
                 conn.sudo('sleep 5')
                 conn.sudo('rm -rf /home/{}/.ensure_dir/dataengine-service_{}_interpreter_ensured'.format(ssh_user, dataproc_name))
-            if exists('/home/{}/.ensure_dir/rstudio_dataengine-service_ensured'.format(ssh_user)):
+            if exists(conn, '/home/{}/.ensure_dir/rstudio_dataengine-service_ensured'.format(ssh_user)):
                 datalab.fab.remove_rstudio_dataengines_kernel(computational_name, ssh_user)
             conn.sudo('rm -rf  /opt/{0}/{1}/'.format(dataproc_version, dataproc_name))
             print("Notebook's {} kernels were removed".format(env.hosts))
@@ -1398,7 +1398,7 @@ def configure_local_spark(jars_dir, templates_dir, memory_type='driver'):
     try:
         # Checking if spark.jars parameter was generated previously
         spark_jars_paths = None
-        if exists('/opt/spark/conf/spark-defaults.conf'):
+        if exists(conn, '/opt/spark/conf/spark-defaults.conf'):
             try:
                 spark_jars_paths = conn.sudo('cat /opt/spark/conf/spark-defaults.conf | grep -e "^spark.jars " ').stdout.replace('\n','')
             except:
@@ -1454,7 +1454,7 @@ def remove_dataengine_kernels(notebook_name, os_user, key_path, cluster_name):
         env.key_filename = "{}".format(key_path)
         env.host_string = env.user + "@" + env.hosts
         conn.sudo('rm -rf /home/{}/.local/share/jupyter/kernels/*_{}'.format(os_user, cluster_name))
-        if exists('/home/{}/.ensure_dir/dataengine_{}_interpreter_ensured'.format(os_user, cluster_name)):
+        if exists(conn, '/home/{}/.ensure_dir/dataengine_{}_interpreter_ensured'.format(os_user, cluster_name)):
             if os.environ['notebook_multiple_clusters'] == 'true':
                 try:
                     livy_port = conn.sudo("cat /opt/" + cluster_name +
@@ -1495,7 +1495,7 @@ def remove_dataengine_kernels(notebook_name, os_user, key_path, cluster_name):
                     zeppelin_restarted = True
             conn.sudo('sleep 5')
             conn.sudo('rm -rf /home/{}/.ensure_dir/dataengine_{}_interpreter_ensured'.format(os_user, cluster_name))
-        if exists('/home/{}/.ensure_dir/rstudio_dataengine_ensured'.format(os_user)):
+        if exists(conn, '/home/{}/.ensure_dir/rstudio_dataengine_ensured'.format(os_user)):
             datalab.fab.remove_rstudio_dataengines_kernel(computational_name, os_user)
         conn.sudo('rm -rf  /opt/' + cluster_name + '/')
         print("Notebook's {} kernels were removed".format(env.hosts))
diff --git a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
index c49e131..fb929df 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -133,7 +133,7 @@ def ensure_pkg(user, requisites='linux-headers-generic python3-pip python3-dev p
 
 def renew_gpg_key():
     try:
-#        if exists('/etc/apt/trusted.gpg'):
+#        if exists(conn, '/etc/apt/trusted.gpg'):
 #            datalab.fab.conn.sudo('mv /etc/apt/trusted.gpg /etc/apt/trusted.bkp')
         datalab.fab.conn.sudo('apt-key update')
     except:
diff --git a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
index c5f7b95..49c4a5a 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
@@ -41,7 +41,7 @@ def enable_proxy(proxy_host, proxy_port):
         datalab.fab.conn.sudo('sed -i "/^export https_proxy/d" /etc/profile')
         datalab.fab.conn.sudo('echo export http_proxy=' + proxy_string + ' >> /etc/profile')
         datalab.fab.conn.sudo('echo export https_proxy=' + proxy_string + ' >> /etc/profile')
-        if exists('/etc/apt/apt.conf'):
+        if exists(datalab.fab.conn, '/etc/apt/apt.conf'):
             datalab.fab.conn.sudo("sed -i '/^Acquire::http::Proxy/d' /etc/apt/apt.conf")
         datalab.fab.conn.sudo("echo 'Acquire::http::Proxy \"" + proxy_string + "\";' >> /etc/apt/apt.conf")
         datalab.fab.conn.sudo("echo 'Acquire::http::Proxy \"" + proxy_https_string + "\";' >> /etc/apt/apt.conf")
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index 4818239..f34aa23 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -59,9 +59,9 @@ def install_pip_pkg(requisites, pip_version, lib_group):
     status = list()
     error_parser = "Could not|No matching|ImportError:|failed|EnvironmentError:|requires|FileNotFoundError:|RuntimeError:|error:"
     try:
-        if pip_version == 'pip3' and not exists('/bin/pip3'):
+        if pip_version == 'pip3' and not exists(conn, '/bin/pip3'):
             for v in range(4, 8):
-                if exists('/bin/pip3.{}'.format(v)):
+                if exists(conn, '/bin/pip3.{}'.format(v)):
                     conn.sudo('ln -s /bin/pip3.{} /bin/pip3'.format(v))
         conn.sudo('{} install -U pip=={} setuptools'.format(pip_version, os.environ['conf_pip_version']))
         conn.sudo('{} install -U pip=={} --no-cache-dir'.format(pip_version, os.environ['conf_pip_version']))
@@ -848,7 +848,7 @@ def replace_multi_symbols(string, symbol, symbol_cut=False):
 def update_pyopenssl_lib(os_user):
     if not exists(conn,'/home/{}/.ensure_dir/pyopenssl_updated'.format(os_user)):
         try:
-            if exists('/usr/bin/pip3'):
+            if exists(conn, '/usr/bin/pip3'):
                 conn.sudo('pip3 install -U pyopenssl')
             conn.sudo('touch /home/{}/.ensure_dir/pyopenssl_updated'.format(os_user))
         except:
diff --git a/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py b/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py
index d9f9cbd..49c6950 100644
--- a/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py
@@ -38,7 +38,7 @@ def enable_proxy(proxy_host, proxy_port):
         conn.sudo('sed -i "/^export https_proxy/d" /etc/profile')
         conn.sudo('echo export http_proxy=' + proxy_string + ' >> /etc/profile')
         conn.sudo('echo export https_proxy=' + proxy_string + ' >> /etc/profile')
-        if exists('/etc/yum.conf'):
+        if exists(conn, '/etc/yum.conf'):
             conn.sudo('sed -i "/^proxy=/d" /etc/yum.conf')
         conn.sudo("echo 'proxy={}' >> /etc/yum.conf".format(proxy_string))
         manage_pkg('clean all', 'remote', '')
diff --git a/infrastructure-provisioning/src/general/scripts/aws/jupyter_install_dataengine-service_kernels.py b/infrastructure-provisioning/src/general/scripts/aws/jupyter_install_dataengine-service_kernels.py
index 914b6d4..eae8d7b 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/jupyter_install_dataengine-service_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/jupyter_install_dataengine-service_kernels.py
@@ -68,7 +68,7 @@ def configure_notebook(args):
     subprocess.run('scp -i {} /usr/lib/python3.8/datalab/*.py {}:/tmp/datalab_libs/'.format(args.keyfile, env.host_string), shell=True, check=True)
     conn.run('chmod a+x /tmp/datalab_libs/*')
     conn.sudo('mv /tmp/datalab_libs/* /usr/lib/python3.8/datalab/')
-    if exists('/usr/lib64'):
+    if exists(conn, '/usr/lib64'):
         conn.sudo('mkdir -p /usr/lib64/python3.8')
         conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/aws/rstudio_install_dataengine-service_kernels.py b/infrastructure-provisioning/src/general/scripts/aws/rstudio_install_dataengine-service_kernels.py
index a2d7e7f..27886ca 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/rstudio_install_dataengine-service_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/rstudio_install_dataengine-service_kernels.py
@@ -56,7 +56,7 @@ def configure_notebook(args):
     conn.local('scp -i {} /usr/lib/python3.8/datalab/*.py {}:/tmp/datalab_libs/'.format(args.keyfile, env.host_string))
     conn.run('chmod a+x /tmp/datalab_libs/*')
     conn.sudo('mv /tmp/datalab_libs/* /usr/lib/python3.8/datalab/')
-    if exists('/usr/lib64'):
+    if exists(conn, '/usr/lib64'):
         conn.sudo('mkdir -p /usr/lib64/python3.8')
         conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/aws/zeppelin_install_dataengine-service_kernels.py b/infrastructure-provisioning/src/general/scripts/aws/zeppelin_install_dataengine-service_kernels.py
index fe89e33..a86e622 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/zeppelin_install_dataengine-service_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/zeppelin_install_dataengine-service_kernels.py
@@ -62,7 +62,7 @@ def configure_notebook(args):
     conn.local('scp -i {} /usr/lib/python3.8/datalab/*.py {}:/tmp/datalab_libs/'.format(args.keyfile, env.host_string))
     conn.run('chmod a+x /tmp/datalab_libs/*')
     conn.sudo('mv /tmp/datalab_libs/* /usr/lib/python3.8/datalab/')
-    if exists('/usr/lib64'):
+    if exists(conn, '/usr/lib64'):
         conn.sudo('mkdir -p /usr/lib64/python3.8')
         conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/jupyter_install_dataengine-service_kernels.py b/infrastructure-provisioning/src/general/scripts/gcp/jupyter_install_dataengine-service_kernels.py
index bee6da4..857b810 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/jupyter_install_dataengine-service_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/jupyter_install_dataengine-service_kernels.py
@@ -65,7 +65,7 @@ def configure_notebook(args):
     conn.local('scp -i {} /usr/lib/python3.8/datalab/*.py {}:/tmp/datalab_libs/'.format(args.keyfile, env.host_string))
     conn.run('chmod a+x /tmp/datalab_libs/*')
     conn.sudo('mv /tmp/datalab_libs/* /usr/lib/python3.8/datalab/')
-    if exists('/usr/lib64'):
+    if exists(conn, '/usr/lib64'):
         conn.sudo('mkdir -p /usr/lib64/python3.8')
         conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/rstudio_install_dataengine-service_kernels.py b/infrastructure-provisioning/src/general/scripts/gcp/rstudio_install_dataengine-service_kernels.py
index 12b2be1..5351f14 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/rstudio_install_dataengine-service_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/rstudio_install_dataengine-service_kernels.py
@@ -57,7 +57,7 @@ def configure_notebook(args):
     subprocess.run('scp -i {} /usr/lib/python3.8/datalab/*.py {}:/tmp/datalab_libs/'.format(args.keyfile, env.host_string), shell=True, check=True)
     conn.run('chmod a+x /tmp/datalab_libs/*')
     conn.sudo('mv /tmp/datalab_libs/* /usr/lib/python3.8/datalab/')
-    if exists('/usr/lib64'):
+    if exists(conn, '/usr/lib64'):
         conn.sudo('mkdir -p /usr/lib64/python3.8')
         conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_install_dataengine-service_kernels.py b/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_install_dataengine-service_kernels.py
index 82df27b..edf1b6b 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_install_dataengine-service_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_install_dataengine-service_kernels.py
@@ -61,7 +61,7 @@ def configure_notebook(args):
     conn.local('scp -i {} /usr/lib/python3.8/datalab/*.py {}:/tmp/datalab_libs/'.format(args.keyfile, env.host_string))
     conn.run('chmod a+x /tmp/datalab_libs/*')
     conn.sudo('mv /tmp/datalab_libs/* /usr/lib/python3.8/datalab/')
-    if exists('/usr/lib64'):
+    if exists(conn, '/usr/lib64'):
         conn.sudo('mkdir -p /usr/lib64/python3.8')
         conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/os/check_inactivity.py b/infrastructure-provisioning/src/general/scripts/os/check_inactivity.py
index 1d54b08..51b3e4a 100644
--- a/infrastructure-provisioning/src/general/scripts/os/check_inactivity.py
+++ b/infrastructure-provisioning/src/general/scripts/os/check_inactivity.py
@@ -48,7 +48,7 @@ if __name__ == "__main__":
     else:
         inactivity_file = 'local_inactivity'
 
-    if exists('{}{}'.format(inactivity_dir, inactivity_file)):
+    if exists(conn, '{}{}'.format(inactivity_dir, inactivity_file)):
         timestamp = conn.sudo('cat {}{}'.format(inactivity_dir, inactivity_file)).stdout.replace('\n','')
     else:
         timestamp = '0000000000'
diff --git a/infrastructure-provisioning/src/general/scripts/os/deeplearning_install_dataengine_kernels.py b/infrastructure-provisioning/src/general/scripts/os/deeplearning_install_dataengine_kernels.py
index 401ccb7..d55f577 100644
--- a/infrastructure-provisioning/src/general/scripts/os/deeplearning_install_dataengine_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/os/deeplearning_install_dataengine_kernels.py
@@ -64,7 +64,7 @@ def configure_notebook(keyfile, hoststring):
         conn.put('/tmp/datalab.tar.gz', '/tmp/datalab.tar.gz')
         conn.sudo('tar -zxvf /tmp/datalab.tar.gz -C /usr/lib/python3.8/datalab/')
         conn.sudo('chmod a+x /usr/lib/python3.8/datalab/*')
-        if exists('/usr/lib64'):
+        if exists(conn, '/usr/lib64'):
             conn.sudo('mkdir -p /usr/lib64/python3.8')
             conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/os/jupyter_install_dataengine_kernels.py b/infrastructure-provisioning/src/general/scripts/os/jupyter_install_dataengine_kernels.py
index a9b0f4b..6d910e5 100644
--- a/infrastructure-provisioning/src/general/scripts/os/jupyter_install_dataengine_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/os/jupyter_install_dataengine_kernels.py
@@ -68,7 +68,7 @@ def configure_notebook(keyfile, hoststring):
         conn.put('/tmp/datalab.tar.gz', '/tmp/datalab.tar.gz')
         conn.sudo('tar -zxvf /tmp/datalab.tar.gz -C /usr/lib/python3.8/datalab/')
         conn.sudo('chmod a+x /usr/lib/python3.8/datalab/*')
-        if exists('/usr/lib64'):
+        if exists(conn, '/usr/lib64'):
             conn.sudo('mkdir -p /usr/lib64/python3.8')
             conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
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 2a0c15d..e8be6fb 100644
--- a/infrastructure-provisioning/src/general/scripts/os/manage_git_creds.py
+++ b/infrastructure-provisioning/src/general/scripts/os/manage_git_creds.py
@@ -41,14 +41,14 @@ if __name__ == "__main__":
     conn = datalab.fab.init_datalab_connection(args.notebook_ip, args.os_user, args.keyfile)
 
     gitlab_certfile = os.environ['conf_gitlab_certfile']
-    if exists('/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
+    if exists(conn, '/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
         install_gitlab_cert(args.os_user, gitlab_certfile)
 
     git_creds = dict()
     try:
-        if exists('/home/{}/.netrc'.format(args.os_user)):
+        if exists(conn, '/home/{}/.netrc'.format(args.os_user)):
             conn.run('rm .netrc')
-        if exists('/home/{}/.gitcreds'.format(args.os_user)):
+        if exists(conn, '/home/{}/.gitcreds'.format(args.os_user)):
             conn.run('rm .gitcreds')
         git_creds = os.environ['git_creds']
     except KeyError as err:
diff --git a/infrastructure-provisioning/src/general/scripts/os/rstudio_install_dataengine_kernels.py b/infrastructure-provisioning/src/general/scripts/os/rstudio_install_dataengine_kernels.py
index e2f9d82..f616670 100644
--- a/infrastructure-provisioning/src/general/scripts/os/rstudio_install_dataengine_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/os/rstudio_install_dataengine_kernels.py
@@ -61,7 +61,7 @@ def configure_notebook(keyfile, hoststring):
         conn.put('/tmp/datalab.tar.gz', '/tmp/datalab.tar.gz')
         conn.sudo('tar -zxvf /tmp/datalab.tar.gz -C /usr/lib/python3.8/datalab/')
         conn.sudo('chmod a+x /usr/lib/python3.8/datalab/*')
-        if exists('/usr/lib64'):
+        if exists(conn, '/usr/lib64'):
             conn.sudo('mkdir -p /usr/lib64/python3.8')
             conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/os/tensor-rstudio_install_dataengine_kernels.py b/infrastructure-provisioning/src/general/scripts/os/tensor-rstudio_install_dataengine_kernels.py
index 496fd8a..850388c 100644
--- a/infrastructure-provisioning/src/general/scripts/os/tensor-rstudio_install_dataengine_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/os/tensor-rstudio_install_dataengine_kernels.py
@@ -63,7 +63,7 @@ def configure_notebook(keyfile, hoststring):
         conn.put('/tmp/datalab.tar.gz', '/tmp/datalab.tar.gz')
         conn.sudo('tar -zxvf /tmp/datalab.tar.gz -C /usr/lib/python3.8/datalab/')
         conn.sudo('chmod a+x /usr/lib/python3.8/datalab/*')
-        if exists('/usr/lib64'):
+        if exists(conn, '/usr/lib64'):
             conn.sudo('mkdir -p /usr/lib64/python3.8')
             conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/os/tensor_install_dataengine_kernels.py b/infrastructure-provisioning/src/general/scripts/os/tensor_install_dataengine_kernels.py
index 8a9f9d0..92f10de 100644
--- a/infrastructure-provisioning/src/general/scripts/os/tensor_install_dataengine_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/os/tensor_install_dataengine_kernels.py
@@ -61,7 +61,7 @@ def configure_notebook(keyfile, hoststring):
         conn.put('/tmp/datalab.tar.gz', '/tmp/datalab.tar.gz')
         conn.sudo('tar -zxvf /tmp/datalab.tar.gz -C /usr/lib/python3.8/datalab/')
         conn.sudo('chmod a+x /usr/lib/python3.8/datalab/*')
-        if exists('/usr/lib64'):
+        if exists(conn, '/usr/lib64'):
             conn.sudo('mkdir -p /usr/lib64/python3.8')
             conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/general/scripts/os/zeppelin_install_dataengine_kernels.py b/infrastructure-provisioning/src/general/scripts/os/zeppelin_install_dataengine_kernels.py
index bca7566..9298a6c 100644
--- a/infrastructure-provisioning/src/general/scripts/os/zeppelin_install_dataengine_kernels.py
+++ b/infrastructure-provisioning/src/general/scripts/os/zeppelin_install_dataengine_kernels.py
@@ -68,7 +68,7 @@ def configure_notebook(keyfile, hoststring):
         conn.put('/tmp/datalab.tar.gz', '/tmp/datalab.tar.gz')
         conn.sudo('tar -zxvf /tmp/datalab.tar.gz -C /usr/lib/python3.8/datalab/')
         conn.sudo('chmod a+x /usr/lib/python3.8/datalab/*')
-        if exists('/usr/lib64'):
+        if exists(conn, '/usr/lib64'):
             conn.sudo('mkdir -p /usr/lib64/python3.8')
             conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
 
diff --git a/infrastructure-provisioning/src/jupyter/scripts/configure_jupyter_node.py b/infrastructure-provisioning/src/jupyter/scripts/configure_jupyter_node.py
index 5ad1b41..1059e21 100644
--- a/infrastructure-provisioning/src/jupyter/scripts/configure_jupyter_node.py
+++ b/infrastructure-provisioning/src/jupyter/scripts/configure_jupyter_node.py
@@ -125,7 +125,7 @@ if __name__ == "__main__":
     install_nodejs(args.os_user)
     print("Install ungit")
     install_ungit(args.os_user, args.exploratory_name, args.edge_ip)
-    if exists('/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
+    if exists(conn, '/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
         install_gitlab_cert(args.os_user, gitlab_certfile)
 
     # INSTALL INACTIVITY CHECKER
diff --git a/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py b/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py
index 52d87f1..d1a5a9a 100644
--- a/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py
+++ b/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py
@@ -106,7 +106,7 @@ if __name__ == "__main__":
     install_nodejs(args.os_user)
     print("Install ungit")
     install_ungit(args.os_user, args.exploratory_name, args.edge_ip)
-    if exists('/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
+    if exists(conn, '/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
         install_gitlab_cert(args.os_user, gitlab_certfile)
 
     # INSTALL INACTIVITY CHECKER
diff --git a/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py b/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py
index 909bd6c..b51adf1 100644
--- a/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py
+++ b/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py
@@ -104,7 +104,7 @@ if __name__ == "__main__":
     install_nodejs(args.os_user)
     print("Install Ungit")
     install_ungit(args.os_user, args.exploratory_name, args.edge_ip)
-    if exists('/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
+    if exists(conn, '/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
         install_gitlab_cert(args.os_user, gitlab_certfile)
 
     # INSTALL INACTIVITY CHECKER
diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_ui.py b/infrastructure-provisioning/src/ssn/scripts/configure_ui.py
index 7a1f0a1..4b2c589 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_ui.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_ui.py
@@ -96,7 +96,7 @@ def copy_ssn_libraries():
         subprocess.run('scp -i {} /usr/lib/python3.8/datalab/*.py {}:/tmp/datalab_libs/'.format(args.keyfile, host_string), shell=True, check=True)
         conn.run('chmod a+x /tmp/datalab_libs/*')
         conn.sudo('mv /tmp/datalab_libs/* /usr/lib/python3.8/datalab/')
-        if exists('/usr/lib64'):
+        if exists(conn, '/usr/lib64'):
             conn.sudo('mkdir -p /usr/lib64/python3.8')
             conn.sudo('ln -fs /usr/lib/python3.8/datalab /usr/lib64/python3.8/datalab')
     except Exception as err:
diff --git a/infrastructure-provisioning/src/superset/scripts/configure_superset_node.py b/infrastructure-provisioning/src/superset/scripts/configure_superset_node.py
index 77faf26..5122ab4 100644
--- a/infrastructure-provisioning/src/superset/scripts/configure_superset_node.py
+++ b/infrastructure-provisioning/src/superset/scripts/configure_superset_node.py
@@ -74,7 +74,7 @@ if __name__ == "__main__":
     install_nodejs(args.os_user)
     print("Install ungit")
     install_ungit(args.os_user, args.superset_name, args.edge_instance_private_ip)
-    if exists('/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
+    if exists(conn, '/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
         install_gitlab_cert(args.os_user, gitlab_certfile)
 
         # INSTALL INACTIVITY CHECKER
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 5f0c9cb..d8b5e79 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
@@ -122,7 +122,7 @@ if __name__ == "__main__":
     install_nodejs(args.os_user)
     print("Install Ungit")
     install_ungit(args.os_user, args.exploratory_name, args.edge_ip)
-    if exists('/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
+    if exists(conn, '/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
         install_gitlab_cert(args.os_user, gitlab_certfile)
 
     # INSTALL INACTIVITY CHECKER
diff --git a/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py b/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py
index 9f239bc..ccdb567 100644
--- a/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py
+++ b/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py
@@ -125,7 +125,7 @@ if __name__ == "__main__":
     install_nodejs(args.os_user)
     print("Install Ungit")
     install_ungit(args.os_user, args.exploratory_name, args.edge_ip)
-    if exists('/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
+    if exists(conn, '/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
         install_gitlab_cert(args.os_user, gitlab_certfile)
 
     # INSTALL INACTIVITY CHECKER
diff --git a/infrastructure-provisioning/src/zeppelin/scripts/configure_zeppelin_node.py b/infrastructure-provisioning/src/zeppelin/scripts/configure_zeppelin_node.py
index 925737f..ccfd39a 100644
--- a/infrastructure-provisioning/src/zeppelin/scripts/configure_zeppelin_node.py
+++ b/infrastructure-provisioning/src/zeppelin/scripts/configure_zeppelin_node.py
@@ -149,7 +149,7 @@ def configure_local_livy_kernels(args):
         conn.sudo('cp -f /tmp/interpreter.json /opt/zeppelin/conf/interpreter.json')
         conn.sudo('echo "livy.server.port = ' + str(livy_port) + '" >> /opt/livy/conf/livy.conf')
         conn.sudo('''echo "SPARK_HOME='/opt/spark/'" >> /opt/livy/conf/livy-env.sh''')
-        if exists('/opt/livy/conf/spark-blacklist.conf'):
+        if exists(conn, '/opt/livy/conf/spark-blacklist.conf'):
             conn.sudo('sed -i "s/^/#/g" /opt/livy/conf/spark-blacklist.conf')
         conn.sudo("systemctl start livy-server")
         conn.sudo('chown ' + args.os_user + ':' + args.os_user + ' -R /opt/zeppelin/')
@@ -253,7 +253,7 @@ if __name__ == "__main__":
     install_nodejs(args.os_user)
     print("Install Ungit")
     install_ungit(args.os_user, args.exploratory_name, args.edge_ip)
-    if exists('/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
+    if exists(conn, '/home/{0}/{1}'.format(args.os_user, gitlab_certfile)):
         install_gitlab_cert(args.os_user, gitlab_certfile)
     # COPY PRE-COMMIT SCRIPT TO ZEPPELIN
     conn.sudo('cp /home/{}/.git/templates/hooks/pre-commit /opt/zeppelin/notebook/.git/hooks/'.format(args.os_user))


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