Skip to content

Conversation

@avanigupta
Copy link
Member

@avanigupta avanigupta commented Mar 17, 2021

Description

There was a bug in converting KeyValue object to JSON during print preview of az appconfig kv restore command. Fixed the bug by accessing the correct property, which is called locked, instead of read_only.

Testing Guide

This is the unhandled error that will be fixed by this PR:

az appconfig kv restore -n test-appconfig-00  --datetime 2021-03-16T00:00:00Z

---------------- Preview (Beta) ----------------

Deleting:
The command failed with an unexpected error. Here is the traceback:
'KeyValue' object has no attribute 'read_only'
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-up6eyly2\knack\cli.py", line 233, in invoke
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-cg742dxv\azure\cli\core\commands\__init__.py", line 664, in execute
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-cg742dxv\azure\cli\core\commands\__init__.py", line 727, in _run_jobs_serially
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-cg742dxv\azure\cli\core\commands\__init__.py", line 720, in _run_job
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c__gk16o\six.py", line 703, in reraise
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-cg742dxv\azure\cli\core\commands\__init__.py", line 698, in _run_job
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-cg742dxv\azure\cli\core\commands\__init__.py", line 331, in __call__
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-cg742dxv\azure\cli\core\__init__.py", line 816, in default_command_handler
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-4iz7mv8d\azure\cli\command_modules\appconfig\keyvalue.py", line 672, in restore_key
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-4iz7mv8d\azure\cli\command_modules\appconfig\_kv_helpers.py", line 664, in __print_restore_preview
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-4iz7mv8d\azure\cli\command_modules\appconfig\_kv_helpers.py", line 544, in __serialize_kv_list_to_comparable_json_list
AttributeError: 'KeyValue' object has no attribute 'read_only'
To open an issue, please run: 'az feedback'

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


This checklist is used to make sure that common guidelines for a pull request are followed.

@avanigupta avanigupta requested a review from qwordy as a code owner March 17, 2021 16:59
@avanigupta avanigupta force-pushed the avanigupta/fixrestorepreview branch from e8ee679 to 9c21036 Compare March 17, 2021 17:06
@avanigupta
Copy link
Member Author

cc @shenmuxiaosen

Copy link
Contributor

@shenmuxiaosen shenmuxiaosen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@avanigupta
Copy link
Member Author

avanigupta commented Mar 22, 2021

Hi @jiasli / @fengzhou-msft , can you please review this PR and merge it?

@qwordy qwordy merged commit 7a5538f into Azure:dev Mar 29, 2021
@avanigupta avanigupta deleted the avanigupta/fixrestorepreview branch March 29, 2021 16:59
@avanigupta avanigupta changed the title {AppConfig} Fix bug in print preview of restore command [AppConfig] Fix bug in print preview of restore command Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants