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/04/09 08:44:44 UTC

[incubator-datalab] branch DATALAB-2091 updated: [DATALAB-2091]: added ensure dir for remove_unexisting_kernel

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 d9819c6  [DATALAB-2091]: added ensure dir for remove_unexisting_kernel
d9819c6 is described below

commit d9819c689f09ae89e6f1b612ea39e8a5d2dc62f1
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Fri Apr 9 11:44:32 2021 +0300

    [DATALAB-2091]: added ensure dir for remove_unexisting_kernel
---
 infrastructure-provisioning/src/general/lib/os/fab.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index 86f77ae..313e1de 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -247,10 +247,13 @@ def configure_jupyter(os_user, jupyter_conf_file, templates_dir, jupyter_version
 
 
 def remove_unexisting_kernel():
-    try:
-        conn.sudo('jupyter-kernelspec remove -f python3')
-    except Exception as err:
-        print('Error:', str(err))
+    if not exists(conn,'/home/{}/.ensure_dir/unexisting_kernel_removed'.format(os_user)):
+        try:
+            conn.sudo('jupyter-kernelspec remove -f python3')
+            conn.sudo('touch /home/{}/.ensure_dir/unexisting_kernel_removed'.format(os_user))
+        except Exception as err:
+            print('Error:', str(err))
+            sys.exit(1)
 
 def configure_docker(os_user):
     try:

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