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 d2a46262d76f2d6f64f345c81104020a0f9d9333
Author: leonidfrolov <[email protected]>
AuthorDate: Tue May 25 16:02:28 2021 +0300

    [DATALAB-2091]: added connection to get_spark_memory
---
 infrastructure-provisioning/src/general/lib/os/fab.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py 
b/infrastructure-provisioning/src/general/lib/os/fab.py
index 3185b65..d934aa9 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -845,9 +845,9 @@ def restart_zeppelin(creds=False, os_user='', hostname='', 
keyfile=''):
 
 def get_spark_memory(creds=False, os_user='', hostname='', keyfile=''):
     if creds:
-        with settings(host_string='{}@{}'.format(os_user, hostname)):
-            mem = conn.sudo('free -m | grep Mem | tr -s " " ":" | cut -f 2 -d 
":"').stdout.replace('\n','')
-            instance_memory = int(mem)
+        con = init_datalab_connection(hostname, os_user, keyfile)
+        con.sudo('free -m | grep Mem | tr -s " " ":" | cut -f 2 -d 
":"').stdout.replace('\n','')
+        instance_memory = int(mem)
     else:
         mem = conn.sudo('free -m | grep Mem | tr -s " " ":" | cut -f 2 -d 
":"').stdout.replace('\n','')
         instance_memory = int(mem)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to