You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by my...@apache.org on 2020/02/28 12:25:49 UTC

[incubator-dlab] 01/01: [DLAB-1570]: 'npm' fixes updated

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

mykolabodnar pushed a commit to branch DLAB-1570
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 31b5cc24542b5fccf4ff86173066949b9f60eabf
Author: Mykola_Bodnar1 <bo...@gmail.com>
AuthorDate: Fri Feb 28 14:25:27 2020 +0200

    [DLAB-1570]: 'npm' fixes updated
---
 .../src/general/lib/os/debian/common_lib.py        | 23 --------------------
 .../src/general/lib/os/fab.py                      | 25 +++++++++++++++++++++-
 2 files changed, 24 insertions(+), 24 deletions(-)

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 028735c..2ca635d 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -27,29 +27,6 @@ import sys
 import os
 import time
 
-def manage_npm_pkg(command):
-    try:
-        npm_count = 0
-        installed = False
-        npm_registry = ['https://registry.npmjs.org/', 'https://registry.npmjs.com/']
-        while not installed:
-            if npm_count > 60:
-                print("NPM registry is not available, please try later")
-                sys.exit(1)
-            else:
-                try:
-                    if npm_count % 2 == 0:
-                        sudo('npm config set registry {}'.format(npm_registry[0]))
-                    else:
-                        sudo('npm config set registry {}'.format(npm_registry[1]))
-                    sudo('npm {}'.format(command))
-                    installed = True
-                except:
-                    npm_count += 1
-                    time.sleep(50)
-    except:
-        sys.exit(1)
-
 
 def manage_pkg(command, environment, requisites):
     try:
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index a13daa7..055df43 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -499,7 +499,7 @@ def ensure_toree_local_kernel(os_user, toree_link, scala_kernel_path, files_dir,
             sys.exit(1)
 
 
-def (os_user, notebook_name, edge_ip):
+def install_ungit(os_user, notebook_name, edge_ip):
     if not exists('/home/{}/.ensure_dir/ungit_ensured'.format(os_user)):
         try:
             manage_npm_pkg('-g install ungit@{}'.format(os.environ['notebook_ungit_version']))
@@ -868,3 +868,26 @@ def configure_superset(os_user, keycloak_auth_server_url, keycloak_realm_name, k
     except Exception as err:
         print("Failed configure superset: " + str(err))
         sys.exit(1)
+
+def manage_npm_pkg(command):
+    try:
+        npm_count = 0
+        installed = False
+        npm_registry = ['https://registry.npmjs.org/', 'https://registry.npmjs.com/']
+        while not installed:
+            if npm_count > 60:
+                print("NPM registry is not available, please try later")
+                sys.exit(1)
+            else:
+                try:
+                    if npm_count % 2 == 0:
+                        sudo('npm config set registry {}'.format(npm_registry[0]))
+                    else:
+                        sudo('npm config set registry {}'.format(npm_registry[1]))
+                    sudo('npm {}'.format(command))
+                    installed = True
+                except:
+                    npm_count += 1
+                    time.sleep(50)
+    except:
+        sys.exit(1)
\ No newline at end of file


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