Fixing index when users need to choose multiple images.
Bug:120723082
Test: 1. $acloud delete , check if any side effect.
2. $acloud create --local-image , check the index is correct or
not.
Change-Id: Id2cce348d0dfe9735559ec12b47b7833068f3fc9
diff --git a/internal/lib/utils.py b/internal/lib/utils.py
index 682a177..f7df259 100755
--- a/internal/lib/utils.py
+++ b/internal/lib/utils.py
@@ -822,14 +822,17 @@
"""
print("[0] to exit.")
start_index = 1
+ max_choice = len(answer_list)
+
if enable_choose_all:
start_index = 2
+ max_choice += 1
print("[1] for all.")
for num, item in enumerate(answer_list, start_index):
print("[%d] %s" % (num, item))
choice = -1
- max_choice = len(answer_list) + 1
+
while True:
try:
choice = raw_input("Enter your choice[0-%d]: " % max_choice)