| Server IP : 162.253.224.18 / Your IP : 216.73.216.135 Web Server : Apache System : Linux s18.infinitysrv.com 3.10.0-962.3.2.lve1.5.89.el7.x86_64 #1 SMP Thu Jul 9 15:55:31 UTC 2026 x86_64 User : dejavumk ( 1184) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/lib/Acronis/PyTools/commands/ |
Upload File : |
import sys
import subprocess
import acrobind
import acrort
def run_tool(argument):
command = argument['Command']
wait_timeout = argument.get('Timeout')
command_line = '{0} -m {1}'.format(sys.executable, command)
argv = command_line
if sys.platform != 'win32':
import shlex
argv = shlex.split(command_line)
tool = subprocess.Popen(argv, universal_newlines=True, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(result, stderr) = tool.communicate(timeout=wait_timeout)
if tool.returncode != 0:
acrort.common.make_logic_error(stderr).throw()
return {'stdout': result}
def execute(*args, **kw):
ctx = acrort.remoting.CommandContext(*args, **kw)
arg = acrobind.unit2py(ctx.argument)
return run_tool(arg)