Skip to content

Commit

Permalink
Add DestroyCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
Klee Dienes committed Aug 30, 2023
1 parent f7c0918 commit 541775e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions carthage/runner_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down Expand Up @@ -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)

0 comments on commit 541775e

Please sign in to comment.