Bug 1564874

Summary: validate existing stacks on 'openstack stack delete'
Product: Red Hat OpenStack Reporter: Ronnie Rasouli <rrasouli>
Component: openstack-heatAssignee: Zane Bitter <zbitter>
Status: CLOSED NOTABUG QA Contact: Ronnie Rasouli <rrasouli>
Severity: low Docs Contact:
Priority: unspecified    
Version: 13.0 (Queens)CC: mburns, ramishra, rhel-osp-director-maint, sbaker, shardy, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-11 00:07:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ronnie Rasouli 2018-04-08 12:53:17 UTC
Description of problem:

We do not validate on openstack stack delete command an existing stacks, in case the stack does not exist then the command fails. 

openstack stack delete foo
Are you sure you want to delete this stack(s) [y/N]? y
Stack not found: foo
Unable to delete 1 of the 1 stacks.

Version-Release number of selected component (if applicable):
all versions

How reproducible:
100%

Steps to Reproduce:
1. delete a non existing stack
2. approve the dialog Y
3. 

Actual results:
The validation appears after the command

Expected results:

Validate the stack existance prior the approval dialog. (Are you sure you want to delete this stack(s) [y/N]? y)

Additional info:

Comment 3 Rabi Mishra 2018-04-10 14:51:07 UTC
IMO it's expected to work that way and is not a bug as we don't check for the existence of the stack before making a REST call for delete. If the expectation is that yes/no prompt should not appear if the stack does not exist, then we have to make another REST call before the DELETE which I don't think is justified.