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"
This commit is contained in:
James 2011-07-18 11:56:41 -04:00
parent b7819211ac
commit a45cc5f29e
1 changed files with 8 additions and 3 deletions

View File

@ -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):