Skip to content

Commit

Permalink
{Interactive} Fix KeyError when entering param not in sample in sce…
Browse files Browse the repository at this point in the history
…nario mode (#6541)

* Fix error when enter short param in scenario mode

* Fix error when enter short param in scenario mode

* Update HISTORY.rst

* Release New Version
  • Loading branch information
ReaNAiveD authored Aug 1, 2023
1 parent 8e16b69 commit 02742a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/interactive/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
Release History
===============

upcoming
0.5.2
+++++
* Fix Scenario Idx out of bound when selecting recommended scenario
* Add command skipped message in Scenario Execution Mode
* Fix Scenario Idx out of bound when selecting recommended scenario
* Fix `KeyError` when entering param not in sample in scenario mode

0.5.1
+++++
Expand Down
2 changes: 1 addition & 1 deletion src/interactive/azext_interactive/azclishell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

VERSION = '0.5.1'
VERSION = '0.5.2'
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# --------------------------------------------------------------------------------------------

import re
from collections import defaultdict

from prompt_toolkit.auto_suggest import AutoSuggest, Suggestion

Expand Down Expand Up @@ -31,7 +32,7 @@ def update(self, sample: str):
# The sample should not start with 'az '
self.cur_sample = sample.split('az ')[-1]
# Find parameters used in sample and its value
self.param_sample_value_map = {}
self.param_sample_value_map = defaultdict(lambda: None)
# Find the command part of sample
self.cur_command = self.cur_sample.split('-')[0].strip()
cur_param = ''
Expand Down

0 comments on commit 02742a8

Please sign in to comment.