Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/interactive/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

upcoming
+++++
* Fix Scenario Idx out of bound when selecting recommended scenario

0.5.1
+++++
* Fix bugs to prevent users from exiting the entire az interactive by using Ctrl+C during command execution
Expand Down
4 changes: 2 additions & 2 deletions src/interactive/azext_interactive/azclishell/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,11 @@ def handle_scenario(self, text):
# e.g. :: 1 => `selected_option='1'`
selected_option = text.partition(SELECT_SYMBOL['example'])[2].strip()
try:
selected_option = int(selected_option)
selected_option = int(selected_option) - 1
except ValueError:
print("An Integer should follow the colon", file=self.output)
return
if 0 <= selected_option <= len(self.recommender.get_scenarios() or []):
if 0 <= selected_option < len(self.recommender.get_scenarios() or []):
scenario = self.recommender.get_scenarios()[selected_option]
self.recommender.feedback_scenario(selected_option, scenario)
else:
Expand Down