Implement command running through pylxd

os-repl
root 2022-11-24 20:14:07 +00:00
parent ac11b1c359
commit f3e0495f12
2 changed files with 7 additions and 0 deletions

View File

@ -24,3 +24,10 @@ def destroy_instance(container_name: str):
instance.delete(wait=True) instance.delete(wait=True)
return True return True
def execute_command(container_name: str, command: str):
instance = lxd_client.instances.get(container_name)
result_tuple = instance.execute([command])
return result_tuple

0
setup.sh Normal file → Executable file
View File