Skip to content

Commit

Permalink
cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
bra-fsn committed May 31, 2024
1 parent 1ffc21e commit 2d6bb02
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sc_runner/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def destroy(**kwargs):
pass


@add_click_opts(runner.pulumi_stack)
@cli.group()
def cancel(**kwargs):
pass


for vendor in data.vendors():
if vendor not in resources.supported_vendors:
# exclude not yet supported vendors
Expand All @@ -64,10 +70,17 @@ def destroy_resources(ctx, **kwargs):
vendor = ctx.command.name
runner.destroy(vendor, pulumi_opts, kwargs)

@cancel.command(name=vendor)
@click.pass_context
def cancel_resources(ctx, **kwargs):
pulumi_opts = ctx.parent.params
vendor = ctx.command.name
runner.cancel(vendor, pulumi_opts, kwargs)

# add click options from the resource method's annotated argument list
add_click_opts(getattr(resources, f"{resources.PREFIX}{vendor}"))(create_resources)
add_click_opts(getattr(resources, f"{resources.PREFIX}{vendor}"))(destroy_resources)
add_click_opts(getattr(resources, f"{resources.PREFIX}{vendor}"))(cancel_resources)


if __name__ == "__main__":
Expand Down

0 comments on commit 2d6bb02

Please sign in to comment.