From 6b121de92178db5868fab86429dd7f2fc4b7265f Mon Sep 17 00:00:00 2001 From: qinkaiwu Date: Wed, 19 Jul 2023 17:12:00 +0800 Subject: [PATCH 1/2] Fix Scenario Idx out of bound when selecting recommended scenario --- src/interactive/azext_interactive/azclishell/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interactive/azext_interactive/azclishell/app.py b/src/interactive/azext_interactive/azclishell/app.py index 12ae42bcd25..be8c4494b2f 100644 --- a/src/interactive/azext_interactive/azclishell/app.py +++ b/src/interactive/azext_interactive/azclishell/app.py @@ -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: From 3c4abb1ff136579581b83a0e9a6feeb2a4338a8b Mon Sep 17 00:00:00 2001 From: qinkaiwu Date: Fri, 21 Jul 2023 14:05:36 +0800 Subject: [PATCH 2/2] Add message in `HISTORY.rst` --- src/interactive/HISTORY.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/interactive/HISTORY.rst b/src/interactive/HISTORY.rst index ae29fe965ef..873234d54ea 100644 --- a/src/interactive/HISTORY.rst +++ b/src/interactive/HISTORY.rst @@ -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