azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

"Signalr show" fails with unexpected error when the resource doesn't exist

Open rachelvweber opened this issue 7 years ago • 1 comments

Describe the bug

"Signalr show" fails with unexpected error when the signalr service doesn't exist. When the service does exist, "signalr show" works as expected.

Command Name az signalr show

Errors:

The command failed with an unexpected error. Here is the traceback:


'CommandResultItem' object is not iterable
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-76yvurxi\knack\knack\cli.py", line 212, in invoke
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-76yvurxi\knack\knack\output.py", line 132, in out
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-76yvurxi\knack\knack\output.py", line 38, in format_json
TypeError: 'CommandResultItem' object is not iterable

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az signalr show --name <nonexistent-signalr-service> --resource-group <existing-resource-group>

Expected Behavior

Printing an error message like "Signalr service doesn't exist"

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.6.6
Shell: powershell.exe

azure-cli 2.0.68

Extensions:
application-insights 0.1.1

Additional Context

rachelvweber avatar Jul 10 '19 15:07 rachelvweber

The fix for this issue seems to be to change the g.command('show',...) in https://github.com/Azure/azure-cli/blob/86ff170f45d1f04a65ab1bc8278cdb112ace5b10/src/azure-cli/azure/cli/command_modules/signalr/commands.py#L34 to g.show_command('show', ...)

stan-sz avatar Feb 18 '20 12:02 stan-sz