From a45cc5f29e63ccf738b5e42fde1f890b0d347dab Mon Sep 17 00:00:00 2001 From: James Date: Mon, 18 Jul 2011 11:56:41 -0400 Subject: [PATCH] CC-2546: Airtime-import does not confirm to change the storage dir - Confirm default to "N" and it accepts "Y" or "y" - It spits out error msg when input is any other then "Y","y","n","N" --- utils/airtime-import/airtime-import.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/airtime-import/airtime-import.py b/utils/airtime-import/airtime-import.py index be1a5f9c5..c5b29036c 100644 --- a/utils/airtime-import/airtime-import.py +++ b/utils/airtime-import/airtime-import.py @@ -195,9 +195,14 @@ def StorageSetAction(option, opt, value, parser): parser.rargs.remove('--force') if(not bypass): errorIfMultipleOption(parser.rargs, "Only [-f] and [--force] option is allowed with this option.") - confirm = raw_input("Are you sure you want to change the storage direcory? (Y/n)") - confirm = confirm or 'Y' - if(confirm != 'Y'): + possibleInput = {'y','Y','n','N'} + confirm = raw_input("Are you sure you want to change the storage direcory? (y/N)") + confirm = confirm or 'N' + while(confirm not in possibleInput): + print "Not an acceptable input: %s" % confirm + confirm = raw_input("Are you sure you want to change the storage direcory? (y/N)") + confirm = confirm or 'N' + if(confirm == 'n' or confirm =='N'): sys.exit(1) if(len(parser.rargs) > 1):