Поднимите ошибку, недопустимое выражение v # при попытке создать интерфейс Azure nic через az cli - PullRequest
0 голосов
/ 26 сентября 2019

Я пытаюсь создать сетевой интерфейс в Azure с помощью команды AZ Cli, и он показывает следующую ошибку.У 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 голосов
/ 30 сентября 2019

Кажется, вам нужно обновить версию Python, не могли бы вы обновить Python до 2.7.7

...