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/11/11 15:28:29 UTC

[incubator-datalab] 01/01: [DATALAB-2567]: disabled openssh update and added scp removal on nodes

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

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

commit 3be5cd7aefe04e1816f983e06adc96855e69cff7
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Thu Nov 11 17:28:15 2021 +0200

    [DATALAB-2567]: disabled openssh update and added scp removal on nodes
---
 .../src/base/scripts/install_prerequisites.py                |  7 +++++--
 .../src/general/lib/os/debian/common_lib.py                  | 12 ++++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/src/base/scripts/install_prerequisites.py b/infrastructure-provisioning/src/base/scripts/install_prerequisites.py
index 5e9ac24..007f0e1 100644
--- a/infrastructure-provisioning/src/base/scripts/install_prerequisites.py
+++ b/infrastructure-provisioning/src/base/scripts/install_prerequisites.py
@@ -60,8 +60,11 @@ if __name__ == "__main__":
         traceback.print_exc()
         sys.exit(1)
 
-    logging.info("Updating openssh to version")
-    ensure_openssh_version(args.user)
+    logging.info("Disable scp on nodes")
+    disable_edge_scp_binary(args.user)
+
+    #logging.info("Updating openssh to version")
+    #ensure_openssh_version(args.user)
 
     logging.info("Installing python packages: {}".format(args.pip_packages))
     ensure_pip(args.pip_packages)
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 e98c183..dc4920c 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -284,6 +284,18 @@ def find_java_path_local():
         traceback.print_exc()
         sys.exit(1)
 
+
+def disable_edge_scp_binary(os_user):
+    try:
+        if not exists(datalab.fab.conn, '/home/{}/.ensure_dir/disabled_scp_binary'.format(os_user)):
+            datalab.fab.conn.sudo('mv /usr/bin/scp /usr/bin/scp_disabled')
+        datalab.fab.conn.sudo('touch /home/{}/.ensure_dir/disabled_scp_binary'.format(os_user))
+    except Exception as err:
+        logging.error('Updating openssh to version:', str(err))
+        traceback.print_exc()
+        sys.exit(1)
+
+
 def ensure_openssh_version(os_user):
     try:
         if not exists(datalab.fab.conn,'/home/{}/.ensure_dir/openssh_version_ensured'.format(os_user)):

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