【发布时间】:2021-06-11 03:23:46
【问题描述】:
命令名称
我试过az servicebus namespace list,但是在一些输出之后它给了我 NoneType 错误意味着没有数据被检索到。此链接中提供了已安装的python包https://github.com/Azure/azure-cli/issues/18428#issuecomment-858293708
错误:
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
File "C:\Users\Mp\AppData\Roaming\Python\Python39\site-packages\knack\cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "C:\Python39\lib\site-packages\azure\cli\core\commands\__init__.py", line 657, in execute
raise ex
File "C:\Python39\lib\site-packages\azure\cli\core\commands\__init__.py", line 720, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "C:\Python39\lib\site-packages\azure\cli\core\commands\__init__.py", line 704, in _run_job
result = list(result)
File "C:\Users\Mp\AppData\Roaming\Python\Python39\site-packages\azure\core\paging.py", line 129, in __next__
return next(self._page_iterator)
File "C:\Users\Mp\AppData\Roaming\Python\Python39\site-packages\azure\core\paging.py", line 84, in __next__
self.continuation_token, self._current_page = self._extract_data(self._response)
File "C:\Python39\lib\site-packages\azure\mgmt\servicebus\operations\_namespaces_operations.py", line 371, in extract_data
return deserialized.next_link or None, iter(list_of_elem)
TypeError: 'NoneType' object is not iterable
复制:
az servicebus namespace list --subscription {} --query {} --output {}
预期行为
在特定订阅中提供 azure servicebus 列表
环境总结
Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: MSI
azure-cli 2.24.0 *
Extensions:
logic 0.1.3
更新
我意识到这个错误只有在帐户中没有服务总线时才会存在。而不是给 value = [] cli 引发此错误。
【问题讨论】:
标签: python python-3.x azure command-line-interface