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 84d85f8  [DATALAB-2091]: fixed some directing echo output to files 
owned by root
84d85f8 is described below

commit 84d85f8529b22e047270b2e811b63797974cf0de
Author: leonidfrolov <[email protected]>
AuthorDate: Mon Feb 22 14:14:06 2021 +0200

    [DATALAB-2091]: fixed some directing echo output to files owned by root
---
 infrastructure-provisioning/src/general/lib/os/debian/common_lib.py | 4 ++--
 infrastructure-provisioning/src/general/lib/os/fab.py               | 4 ++--
 2 files changed, 4 insertions(+), 4 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 3fb5a21..de6f695 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -164,9 +164,9 @@ def ensure_ntpd(user, edge_private_ip=''):
         if not 
exists(datalab.fab.conn,'/home/{}/.ensure_dir/ntpd_ensured'.format(user)):
             datalab.fab.conn.sudo('timedatectl set-ntp no')
             manage_pkg('-y install', 'remote', 'ntp ntpdate')
-            datalab.fab.conn.sudo('echo "tinker panic 0" >> /etc/ntp.conf')
+            datalab.fab.conn.sudo('bash -c \"echo "tinker panic 0" >> 
/etc/ntp.conf\"')
             if os.environ['conf_resource'] != 'ssn' and 
os.environ['conf_resource'] != 'edge':
-                datalab.fab.conn.sudo('echo "server {} prefer iburst" >> 
/etc/ntp.conf'.format(edge_private_ip))
+                datalab.fab.conn.sudo('bash -c \"echo "server {} prefer 
iburst" >> /etc/ntp.conf\"'.format(edge_private_ip))
             datalab.fab.conn.sudo('systemctl restart ntp')
             datalab.fab.conn.sudo('systemctl enable ntp')
             datalab.fab.conn.sudo('touch 
/home/{}/.ensure_dir/ntpd_ensured'.format(user))
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py 
b/infrastructure-provisioning/src/general/lib/os/fab.py
index d6005ec..3eb50d5 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -41,8 +41,8 @@ from patchwork.files import exists
 def ensure_pip(requisites):
     try:
         if not 
exists(conn,'/home/{}/.ensure_dir/pip_path_added'.format(os.environ['conf_os_user'])):
-            conn.sudo('echo PATH=$PATH:/usr/local/bin/:/opt/spark/bin/ >> 
/etc/profile')
-            conn.sudo('echo export PATH >> /etc/profile')
+            conn.sudo('bash -c "echo 
PATH=$PATH:/usr/local/bin/:/opt/spark/bin/ >> /etc/profile"')
+            conn.sudo('bash -c "echo export PATH >> /etc/profile"')
             conn.sudo('pip3 install -UI pip=={} 
--no-cache-dir'.format(os.environ['conf_pip_version']))
             conn.sudo('pip3 install --upgrade setuptools')
             conn.sudo('pip3 install -UI {} --no-cache-dir'.format(requisites))


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

Reply via email to