Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/azure-cli/azure/cli/command_modules/vm/_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,10 @@ def _load_extension_images_from_publisher(publisher):


def get_vm_sizes(cli_ctx, location):
return list(_compute_client_factory(cli_ctx).virtual_machine_sizes.list(location))
from .operations.vm import VMListSizes
return VMListSizes(cli_ctx=cli_ctx)(command_args={
'location': location
})
Comment on lines 300 to +304
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_vm_sizes previously returned SDK VirtualMachineSize objects (used by the get_vm_size_completion_list completer via r.name). The new AAZ VMListSizes output deserializes to a list of dicts (with a 'name' key), so callers doing attribute access will break. To keep the completer working, either adapt get_vm_sizes to return objects with a .name attribute (e.g., map dicts to a simple object) or update the completer to use r['name'] consistently with other AAZ list outputs.

Copilot uses AI. Check for mistakes.


def _matched(pattern, string, partial_match=True):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_vm_size_completion_list(cmd, prefix, namespace): # pylint: disable=unus
if not location:
location = get_one_of_subscription_locations(cmd.cli_ctx)
result = get_vm_sizes(cmd.cli_ctx, location)
return [r.name for r in result]
return [r.get('name') for r in result]


@Completer
Expand Down