** Description changed:

+ [Impact]
+ 
  The monitor sub-command imports antlr4 at the global level, although it
  is necessary only for an optional sub-option of the sub-command. Given
  antlr4 is not available, this restricts usage of the whole sub-command
  unnecessarily.
+ 
+ [Test Case]
+ 
+   $ az vm list
+   The command failed with an unexpected error. Here is the traceback:
+ 
+   No module named 'antlr4'
+   Traceback (most recent call last):
+     File "/usr/lib/python3/dist-packages/knack/cli.py", line 215, in invoke
+       cmd_result = self.invocation.execute(args)
+     File 
"/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", line 553, 
in execute
+       self.commands_loader.load_arguments(command)
+     File "/usr/lib/python3/dist-packages/azure/cli/core/__init__.py", line 
345, in load_arguments
+       loader.load_arguments(command)  # this adds entries to the argument 
registries
+     File 
"/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/__init__.py", line 
31, in load_arguments
+       from azure.cli.command_modules.vm._params import load_arguments
+     File 
"/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/_params.py", line 
31, in <module>
+       from azure.cli.command_modules.monitor.actions import get_period_type
+     File 
"/usr/lib/python3/dist-packages/azure/cli/command_modules/monitor/actions.py", 
line 7, in <module>
+       import antlr4
+   ModuleNotFoundError: No module named 'antlr4'
+ 
+ [Regression Potential]
+ 
+ Minimal. The same patch has already been upstream for a few releases
+ now, and has been shipping in Debian unstable/testing since early
+ August.
+ 
+ [Other Info]
  
  The issue has been fixed upstream, and the import is now reduced in
  scope:
  
  https://github.com/Azure/azure-cli/pull/14712
  
+ Version 2.10.1-1, which is available in 20.10 Groovy, already contains a
+ backport of this patch.
+ 
  This issue has been reported upstream by Focal users, so it would be
  good to get the patch backported.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1897586

Title:
  azure-cli: global import of antlr4 for optional sub-feature

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/azure-cli/+bug/1897586/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to