fix multi apps
This commit is contained in:
@@ -27,7 +27,7 @@ from .chrome import (
|
||||
get_info_from_website
|
||||
)
|
||||
from .file import get_cloud_file, get_vm_file, get_cache_file, get_content_from_vm_file
|
||||
from .general import get_vm_command_line, get_vm_terminal_output
|
||||
from .general import get_vm_command_line, get_vm_terminal_output, get_vm_command_error
|
||||
from .gimp import get_gimp_config_file
|
||||
from .impress import get_audio_in_slide
|
||||
from .info import get_vm_screen_size, get_vm_window_size, get_vm_wallpaper, get_list_directory
|
||||
|
||||
@@ -21,6 +21,22 @@ def get_vm_command_line(env, config: Dict[str, str]):
|
||||
logger.error("Failed to get vm command line. Status code: %d", response.status_code)
|
||||
return None
|
||||
|
||||
def get_vm_command_error(env, config: Dict[str, str]):
|
||||
vm_ip = env.vm_ip
|
||||
port = 5000
|
||||
command = config["command"]
|
||||
shell = config.get("shell", False)
|
||||
|
||||
response = requests.post(f"http://{vm_ip}:{port}/execute", json={"command": command, "shell": shell})
|
||||
|
||||
print(response.json())
|
||||
|
||||
if response.status_code == 200:
|
||||
return response.json()["error"]
|
||||
else:
|
||||
logger.error("Failed to get vm command line error. Status code: %d", response.status_code)
|
||||
return None
|
||||
|
||||
|
||||
def get_vm_terminal_output(env, config: Dict[str, str]):
|
||||
return env.controller.get_terminal_output()
|
||||
|
||||
Reference in New Issue
Block a user