Skip to content

Commit 06c405b

Browse files
{Compute} az vm image: Migrate command group to aaz-based implementation (#32867)
1 parent 39fd5f8 commit 06c405b

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/azure-cli/azure/cli/command_modules/vm/commands.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from azure.cli.command_modules.vm._client_factory import (cf_vm,
77
cf_vm_ext, cf_vm_ext_image,
8-
cf_vm_image, cf_vm_image_term, cf_usage,
8+
cf_vm_image_term, cf_usage,
99
cf_vmss, cf_images,
1010
cf_galleries, cf_gallery_images, cf_gallery_image_versions,
1111
cf_proximity_placement_groups,
@@ -82,11 +82,6 @@ def load_command_table(self, _):
8282
client_factory=cf_vm_ext_image
8383
)
8484

85-
compute_vm_image_sdk = CliCommandType(
86-
operations_tmpl='azure.mgmt.compute.operations#VirtualMachineImagesOperations.{}',
87-
client_factory=cf_vm_image
88-
)
89-
9085
compute_vm_image_term_sdk = CliCommandType(
9186
operations_tmpl='azure.mgmt.marketplaceordering.operations#MarketplaceAgreementsOperations.{}',
9287
client_factory=cf_vm_image_term
@@ -341,7 +336,7 @@ def load_command_table(self, _):
341336
with self.command_group('vm extension image', compute_vm_extension_image_sdk) as g:
342337
g.custom_command('list', 'list_vm_extension_images')
343338

344-
with self.command_group('vm image', compute_vm_image_sdk) as g:
339+
with self.command_group('vm image') as g:
345340
g.custom_command('list-offers', 'list_offers')
346341
g.custom_command('list-publishers', 'list_publishers')
347342
g.custom_command('list-skus', 'list_sku')

src/azure-cli/azure/cli/command_modules/vm/custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from ._vm_diagnostics_templates import get_default_diag_config
4242

4343
from ._actions import (load_images_from_aliases_doc, load_extension_images_thru_services,
44-
load_images_thru_services, _get_latest_image_version, _get_latest_image_version_by_aaz)
44+
load_images_thru_services, _get_latest_image_version_by_aaz)
4545
from ._client_factory import (_compute_client_factory, cf_vm_image_term)
4646

4747
from .aaz.latest.vm.disk import AttachDetachDataDisk
@@ -2802,7 +2802,7 @@ def show_vm_image(cmd, urn=None, publisher=None, offer=None, sku=None, version=N
28022802
elif len(items) == 4:
28032803
publisher, offer, sku, version = urn.split(":")
28042804
if version.lower() == 'latest':
2805-
version = _get_latest_image_version(cmd.cli_ctx, location, publisher, offer, sku)
2805+
version = _get_latest_image_version_by_aaz(cmd.cli_ctx, location, publisher, offer, sku)
28062806
elif not publisher or not offer or not sku or not version:
28072807
raise RequiredArgumentMissingError(error_msg)
28082808
if edge_zone is not None:

0 commit comments

Comments
 (0)