Azure:AZ CLI ConnectedVMware VM guest-Enable ...返回:“ errorl”对象不可call
使用Azure门户时,我可以选择一个已在Azure中“启用”的VM作为资源,然后对其执行“启用访客管理”操作。 但是,当尝试使用AZ CLI执行相同的更改时,我会收到错误,如下所示...
命令的命令格式.....
az connectedvmware vm guest-agent enable --username "vm user name" --password "vm password" --resource-group "resource group name" --subscription "Name or ID of subscription" --vm-name "vm name"
返回错误……
az ERROR: The command failed with an unexpected error. Here is the traceback:t
C:\Users\Administrator\Desktop\CLI create VM.ps1:9 char:1
az connectedvmware vm guest-agent enable --username "administrator"
CategoryInfo : NotSpecified: (ERROR: The comm... the traceback::String) [],
RemoteException
FullyQualifiedErrorId : NativeCommandError
ERROR: 'str' object is not callable
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line
231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-
packages\azure/cli/core/commands/__init__.py", line 663, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-
packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-
packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Users\Administrator\.azure\cliextensions\connectedvmware\azext_connectedvmware\custom.py", line 1790, in enable_guest_agent
enable_system_identity(vm_client, resource_group_name, vm_name)
File "C:\Users\Administrator\.azure\cliextensions\connectedvmware\azext_connectedvmware\custom.py", line 1770, in enable_system_identity
return sdk_no_wait(
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 693, in sdk_no_wait
TypeError: 'str' object is not callable
我成功地执行了其他各种ConnectedVMware CLI CLI命令使用上面命令提到的各种输入,但是“访客代理”变体似乎始终如一地失败。 任何在工作中的帮助都将不胜感激,
When using the azure portal, I can select a VM that is already 'Enabled' in Azure as a resource then perform the 'Enable Guest Management' action on it.
But when attempting to use the Az cli to perform the same change, I get error as shown below...
Format of command used.....
az connectedvmware vm guest-agent enable --username "vm user name" --password "vm password" --resource-group "resource group name" --subscription "Name or ID of subscription" --vm-name "vm name"
Error returned......
az ERROR: The command failed with an unexpected error. Here is the traceback:t
C:\Users\Administrator\Desktop\CLI create VM.ps1:9 char:1
az connectedvmware vm guest-agent enable --username "administrator"
CategoryInfo : NotSpecified: (ERROR: The comm... the traceback::String) [],
RemoteException
FullyQualifiedErrorId : NativeCommandError
ERROR: 'str' object is not callable
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line
231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-
packages\azure/cli/core/commands/__init__.py", line 663, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-
packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-
packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Users\Administrator\.azure\cliextensions\connectedvmware\azext_connectedvmware\custom.py", line 1790, in enable_guest_agent
enable_system_identity(vm_client, resource_group_name, vm_name)
File "C:\Users\Administrator\.azure\cliextensions\connectedvmware\azext_connectedvmware\custom.py", line 1770, in enable_system_identity
return sdk_no_wait(
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 693, in sdk_no_wait
TypeError: 'str' object is not callable
I am successfully executing other various connectedVMware cli commands that use the various inputs mentioned for the command above but the "guest-agent enable" variant seems to fail consistently.
Any help on working round would be appreciated,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的命令格式绝对可以。
有几个原因来获取此错误,下面就是其中之一。
示例:保留关键字
如果我们在我们的情况下提到了变量名作为保留关键字,则是
str
。示例代码:
输出错误:
上述示例的分辨率:
输出结果:
%
运算符,请确保重新检查,该操作员在字符串上执行格式化。感谢 python pool
typeerror:'str'对象不是可呼叫
。Your format of command is absolutely fine.
There are several reasons to get this error, below is one of them.
Example: Reserved Keyword
If we are mentioned the variable name as a reserved keyword in our case, it is
str
.Sample Code:
Output with Error:
Resolution for the above Example:
Output with Result:
%
operator which performs the formatting on string.Thanks to Python Pool for the detailed information on
TypeError: 'str' object is not callable
.