From 541775e2c8c834ba2194a0e5d943aff754dd2cfc Mon Sep 17 00:00:00 2001 From: Klee Dienes Date: Wed, 30 Aug 2023 14:58:06 +0000 Subject: [PATCH] Add DestroyCommand --- carthage/runner_commands.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/carthage/runner_commands.py b/carthage/runner_commands.py index 60bdecb1..1bbebfb9 100644 --- a/carthage/runner_commands.py +++ b/carthage/runner_commands.py @@ -50,6 +50,13 @@ async def run(self, args): machine = await self.ainjector.get_instance_async(InjectionKey(Machine, host=args.machine)) await machine.stop_machine() +class DestroyCommand(MachineCommand): + + name = 'destroy' + + async def run(self, args): + machine = await self.ainjector.get_instance_async(InjectionKey(Machine, host=args.machine)) + await machine.delete() class ListMachines(MachineCommand): @@ -122,5 +129,6 @@ def enable_runner_commands(ainjector): ainjector.add_provider(ListMachines) ainjector.add_provider(SleepCommand) ainjector.add_provider(StopCommand) + ainjector.add_provider(DestroyCommand) ainjector.add_provider(DumpAssignmentsCommand)