{"action":"created","issue":{"url":"https://api.github.com/repos/cloudreach/sceptre/issues/61","repository_url":"https://api.github.com/repos/cloudreach/sceptre","labels_url":"https://api.github.com/repos/cloudreach/sceptre/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/cloudreach/sceptre/issues/61/comments","events_url":"https://api.github.com/repos/cloudreach/sceptre/issues/61/events","html_url":"https://github.com/cloudreach/sceptre/issues/61","id":210526997,"number":61,"title":"Add confirmation step when deleting","user":{"login":"jamesroutley","id":5308905,"avatar_url":"https://avatars3.githubusercontent.com/u/5308905?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesroutley","html_url":"https://github.com/jamesroutley","followers_url":"https://api.github.com/users/jamesroutley/followers","following_url":"https://api.github.com/users/jamesroutley/following{/other_user}","gists_url":"https://api.github.com/users/jamesroutley/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesroutley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesroutley/subscriptions","organizations_url":"https://api.github.com/users/jamesroutley/orgs","repos_url":"https://api.github.com/users/jamesroutley/repos","events_url":"https://api.github.com/users/jamesroutley/events{/privacy}","received_events_url":"https://api.github.com/users/jamesroutley/received_events","type":"User","site_admin":false},"labels":[{"id":573635533,"url":"https://api.github.com/repos/cloudreach/sceptre/labels/beginner%20friendly","name":"beginner friendly","color":"c5def5","default":false},{"id":529560529,"url":"https://api.github.com/repos/cloudreach/sceptre/labels/help%20wanted","name":"help wanted","color":"006b75","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/cloudreach/sceptre/milestones/1","html_url":"https://github.com/cloudreach/sceptre/milestone/1","labels_url":"https://api.github.com/repos/cloudreach/sceptre/milestones/1/labels","id":2350535,"number":1,"title":"v2.0","description":"Sceptre version 2.0","creator":{"login":"jamesroutley","id":5308905,"avatar_url":"https://avatars3.githubusercontent.com/u/5308905?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesroutley","html_url":"https://github.com/jamesroutley","followers_url":"https://api.github.com/users/jamesroutley/followers","following_url":"https://api.github.com/users/jamesroutley/following{/other_user}","gists_url":"https://api.github.com/users/jamesroutley/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesroutley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesroutley/subscriptions","organizations_url":"https://api.github.com/users/jamesroutley/orgs","repos_url":"https://api.github.com/users/jamesroutley/repos","events_url":"https://api.github.com/users/jamesroutley/events{/privacy}","received_events_url":"https://api.github.com/users/jamesroutley/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":2,"state":"open","created_at":"2017-02-27T16:04:46Z","updated_at":"2017-05-12T13:58:47Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2017-02-27T16:02:13Z","updated_at":"2017-05-19T12:21:30Z","closed_at":null,"body":"Sceptre should ask for user confirmation when deleting stacks or environments. A CLI flag `--yes/-y` will be added, allowing scriptable deletion of resources. This confirmation will only happen on the CLI, not when delete commands are run from \r\n\r\n## Implementation\r\n\r\n- Add a [confirmation prompt](http://click.pocoo.org/5/prompts/#confirmation-prompts) with Click to the function `sceptre.cli.delete_stack`.\r\n- Add a [Click option](http://click.pocoo.org/5/options/) `-y`, which skips the confirmation prompt and runs `env.stacks[stack].delete()`.\r\n\r\n## Pros\r\n- Syntax is in keeping with Unix standards (e.g. `yum install`)\r\n\r\n## Cons"},"comment":{"url":"https://api.github.com/repos/cloudreach/sceptre/issues/comments/302688255","html_url":"https://github.com/cloudreach/sceptre/issues/61#issuecomment-302688255","issue_url":"https://api.github.com/repos/cloudreach/sceptre/issues/61","id":302688255,"user":{"login":"rmbennett","id":1990048,"avatar_url":"https://avatars2.githubusercontent.com/u/1990048?v=3","gravatar_id":"","url":"https://api.github.com/users/rmbennett","html_url":"https://github.com/rmbennett","followers_url":"https://api.github.com/users/rmbennett/followers","following_url":"https://api.github.com/users/rmbennett/following{/other_user}","gists_url":"https://api.github.com/users/rmbennett/gists{/gist_id}","starred_url":"https://api.github.com/users/rmbennett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmbennett/subscriptions","organizations_url":"https://api.github.com/users/rmbennett/orgs","repos_url":"https://api.github.com/users/rmbennett/repos","events_url":"https://api.github.com/users/rmbennett/events{/privacy}","received_events_url":"https://api.github.com/users/rmbennett/received_events","type":"User","site_admin":false},"created_at":"2017-05-19T12:21:30Z","updated_at":"2017-05-19T12:21:30Z","body":"@jamesroutley - The click package offers \"Yes Parameters\" which is 99% of what you want, except you have to add --yes rather than -y. (3rd line below). Would this be acceptable?\r\nhttp://click.pocoo.org/5/options/ <- search Yes Parameters.\r\n\r\n```\r\n@cli.command(name=\"delete-stack\")\r\n@stack_options\r\n@click.confirmation_option(help='Are you sure you want to delete the stack?')\r\n@click.pass_context\r\n@catch_exceptions\r\ndef delete_stack(ctx, environment, stack):\r\n    \"\"\"Deletes the stack.\r\n\r\n    Deletes ENVIRONMENT/STACK.\"\"\"\r\n    env = get_env(ctx.obj[\"sceptre_dir\"], environment, ctx.obj[\"options\"])\r\n    response = env.stacks[stack].delete()\r\n    if response != StackStatus.COMPLETE:\r\n        exit(1)\r\n\r\n```\r\n\r\n "}}
{"actor":{"display_login":"rmbennett"}}