Bug 979992 - Any input validation string beginning with 'y' or 'Y' will work as 'yes' when remove cartridge or delete app.
Any input validation string beginning with 'y' or 'Y' will work as 'yes' when...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Linux
low Severity low
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-01 05:36 EDT by Lei Zhang
Modified: 2015-05-14 22:23 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-22 11:19:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lei Zhang 2013-07-01 05:36:44 EDT
Description of problem:
When delete app or remove cartridge from one app, It prompts "Are you sure you want to ....(Yes|no)", when user input any validation string beginning will 'y' or 'Y', It will work as 'yes', If user input some validation string beginning with 'n' or 'N', it doesn't work as 'no'. 

Version-Release number of selected component (if applicable):
devenv_3430
rhc-1.11.1.gem

How reproducible:
always

Steps to Reproduce:
1.delete one app or remove cartridge from one app
2.input validation string beginning with 'y' or 'Y' when it prompts "Are you sure you want to ......(yes|no)"
3.

Actual results:
Any input validation string beginning with 'y' or 'Y' will was as 'yes'

Expected results:
If string beginning with 'y' or 'Y' work as 'yes', the string begining 'n' or 'N' should work as 'no'.

Additional info:

[rayzhang@rayzhang Work]$ rhc app delete myjbw2 
This is a non-reversible action! Your application code and data will be permanently deleted if you continue!
Are you sure you want to delete the application 'myjbw2'? (yes|no): Yadfasd
Deleting application 'myjbw2' ... deleted
Application myjbw2 is deleted.

[rayzhang@rayzhang Work]$ rhc cartridge remove  -a myruby18s -c mongodb-2.2
Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge.
Are you sure you wish to remove mongodb-2.2 from 'myruby18s'? (yes|no): yasdfasdfasdf
Removing mongodb-2.2 from 'myruby18s' ... removed
Removed mongodb-2.2 from application myruby18s

[rayzhang@rayzhang Work]$ rhc app delete mynds 
This is a non-reversible action! Your application code and data will be permanently deleted if you continue!
Are you sure you want to delete the application 'mynds'? (yes|no): nasasdf
Please enter "yes" or "no".
This is a non-reversible action! Your application code and data will be permanently deleted if you continue!
Are you sure you want to delete the application 'mynds'? (yes|no): Nooadsfasdf
Please enter "yes" or "no".
This is a non-reversible action! Your application code and data will be permanently deleted if you continue!
Are you sure you want to delete the application 'mynds'? (yes|no): no
This action requires the --confirm option (or entering 'yes' at a prompt) to run.
Comment 1 Clayton Coleman 2013-07-09 13:29:36 EDT
Fixed the stty output issue with sending "echo n | rhc delete-app foo" (where it would display stty: Invalid output device ioctl)

Changed it so that only "y", "yes", "n", and "no" will be valid responses.

Fixed in https://github.com/openshift/rhc/pull/425
Comment 2 openshift-github-bot 2013-07-09 17:15:13 EDT
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/4d852130511c89888efb8d053401e5729094ece4
Bug 979992 - Only respond to 'y', 'yes', 'n', and 'no'

Fix non-interactive stty behavior. Keep backwards compatibility of agree for anyone in non-interactive mode.  Also change "success" on app create to "done" to be consistent.
Comment 3 Lei Zhang 2013-07-10 03:19:22 EDT
Verified on INT(devenv_3470), the bug still exists, any strings begin with 'y' or 'Y' work as 'yes'.

[rayzhang@rayzhang Work]$ rhc cartridge remove -a myphp53 -c rockmongo
Using rockmongo-1.1 (RockMongo 1.1) for 'rockmongo'

Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge.

Are you sure you wish to remove rockmongo-1.1 from 'myphp53'? (yes|no): yasdg

Removing rockmongo-1.1 from 'myphp53' ... removed

[rayzhang@rayzhang Work]$ rhc app delete mypython26s
This is a non-reversible action! Your application code and data will be permanently deleted if you continue!

Are you sure you want to delete the application 'mypython26s'? (yes|no): yadsfadsf

Deleting application 'mypython26s' ... deleted

[rayzhang@rayzhang Work]$ rhc cartridge remove  -a myphp  -c mysql-5.1 
Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge.

Are you sure you wish to remove mysql-5.1 from 'myphp'? (yes|no): Yasdfasf

Removing mysql-5.1 from 'myphp' ... removed
Comment 4 Xiaoli Tian 2013-07-10 03:55:00 EDT
Move it back to ON_QA since related fix is not built in rhc-1.11.3, need to test on the latest devenv directly or build one from the latest code.
Comment 5 Lei Zhang 2013-07-10 04:12:01 EDT
Verified on devenv_3473, rhc build from devenv_3473.


[rayzhang@rayzhang Work]$ rhc cartridge remove -a mypython27 -c rockmongo-1.1
Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge.

Are you sure you wish to remove rockmongo-1.1 from 'mypython27'? (yes|no): yasdfasf
Please enter "yes" or "no".
Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge.

Are you sure you wish to remove rockmongo-1.1 from 'mypython27'? (yes|no): nadfasf
Please enter "yes" or "no".
Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge.

Are you sure you wish to remove rockmongo-1.1 from 'mypython27'? (yes|no): n

This action requires the --confirm option (or entering 'yes' at a prompt) to run.
[rayzhang@rayzhang Work]$ rhc cartridge remove -a mypython27 -c rockmongo-1.1
noRemoving a cartridge is a destructive operation that may result in loss of data associated with the cartridge.

Are you sure you wish to remove rockmongo-1.1 from 'mypython27'? (yes|no): no
Please enter "yes" or "no".
Removing a cartridge is a destructive operation that may result in loss of data associated with the cartridge.

Are you sure you wish to remove rockmongo-1.1 from 'mypython27'? (yes|no): y

Removing rockmongo-1.1 from 'mypython27' ... removed

Note You need to log in before you can comment on or make changes to this bug.