shell = False
cmd = ""
- if sudo:
- cmd +="sudo "
if python_path:
python_path.replace("'", r"'\''")
cmd = """PYTHONPATH="$PYTHONPATH":'%s' """ % python_path
repr(os.path.dirname(os.path.dirname(nepi.__file__))).replace("'",'"'),
)
+ if sudo:
+ if ';' in cmd:
+ cmd = "sudo bash -c " + shell_escape(cmd)
+ else:
+ cmd = "sudo " + cmd
+
if communication == DC.ACCESS_SSH:
tmp_known_hosts = None
args = ['ssh',
server_key, host, port, args)
args.append(cmd)
else:
- args = [cmd]
+ args = cmd
shell = True
# connects to the remote host and starts a remote