引发错误,尝试通过az cli创建azure nic接口时,v#表达式无效

时间:2019-09-26 18:31:29

标签: azure azure-cli

我正在尝试使用AZ Cli命令在Azure上创建网络接口,并且显示以下错误。 相同的Ansible模块对urllib3和请求包有一些严格的要求,因此尝试使用Azure cli。 堆栈跟踪看起来像是一个模块问题。

/root/bin/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a release (2.7.7+) that supports hmac.compare_digest as soon as possible.
  utils.PersistentlyDeprecated2018,
The command failed with an unexpected error. Here is the traceback:

nothing to repeat
Traceback (most recent call last):
  File "/root/bin/lib/python2.7/site-packages/knack/cli.py", line 206, in invoke
    cmd_result = self.invocation.execute(args)
  File "/root/bin/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 523, in execute
    self.commands_loader.load_arguments(command)
  File "/root/bin/lib/python2.7/site-packages/azure/cli/core/__init__.py", line 291, in load_arguments
    self.command_table[command].load_arguments()  # this loads the arguments via reflection
  File "/root/bin/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 290, in load_arguments
    super(AzCliCommand, self).load_arguments()
  File "/root/bin/lib/python2.7/site-packages/knack/commands.py", line 97, in load_arguments
    cmd_args = self.arguments_loader()
  File "/root/bin/lib/python2.7/site-packages/azure/cli/core/__init__.py", line 488, in default_arguments_loader
    op = handler or self.get_op_handler(operation, operation_group=kwargs.get('operation_group'))
  File "/root/bin/lib/python2.7/site-packages/azure/cli/core/__init__.py", line 528, in get_op_handler
    op = import_module(mod_to_import)
  File "/opt/rh/python27/root/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/root/bin/lib/python2.7/site-packages/azure/cli/command_modules/network/custom.py", line 23, in <module>
    from azure.cli.command_modules.network.zone_file.parse_zone_file import parse_zone_file
  File "/root/bin/lib/python2.7/site-packages/azure/cli/command_modules/network/zone_file/__init__.py", line 28, in <module>
    from azure.cli.command_modules.network.zone_file.parse_zone_file import parse_zone_file
  File "/root/bin/lib/python2.7/site-packages/azure/cli/command_modules/network/zone_file/parse_zone_file.py", line 77, in <module>
    _COMPILED_REGEX = {k: re.compile(v, re.IGNORECASE) for k, v in _REGEX.items()}
  File "/root/bin/lib/python2.7/site-packages/azure/cli/command_modules/network/zone_file/parse_zone_file.py", line 77, in <dictcomp>
    _COMPILED_REGEX = {k: re.compile(v, re.IGNORECASE) for k, v in _REGEX.items()}
  File "/root/bin/lib64/python2.7/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/root/bin/lib64/python2.7/re.py", line 242, in _compile
    raise error, v # invalid expression
error: nothing to repeat```

Following packages I am using for az cli :
azure-cli                             2.0.71                  
azure-cli-command-modules-nspkg       2.0.3                   
azure-cli-core                        2.0.35                  
azure-cli-nspkg                       3.0.2                   
azure-cli-telemetry                   1.0.3  

1 个答案:

答案 0 :(得分:0)

似乎您的python版本需要升级,请您将python升级到2.7.7