Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yanzhudd committed Jan 14, 2025
1 parent 20f44f9 commit a7b7b6f
Show file tree
Hide file tree
Showing 12 changed files with 5,903 additions and 5,197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ def load_command_table(self, _):

from .operations.capacity_reservation_group import CapacityReservationGroupList
self.command_table['capacity reservation group list'] = CapacityReservationGroupList(loader=self)

from .operations.vm import VMListSizes
self.command_table['vm list-sizes'] = VMListSizes(loader=self)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods, unused-argument
from knack.log import get_logger

from ._util import import_aaz_by_profile

logger = get_logger(__name__)

_VM = import_aaz_by_profile("vm")


class VMListSizes(_VM.ListSizes):
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
args_schema = super()._build_arguments_schema(*args, **kwargs)
args_schema.location._id_part = None

return args_schema
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ def load_command_table(self, _):

from .operations.capacity_reservation_group import CapacityReservationGroupList
self.command_table['capacity reservation group list'] = CapacityReservationGroupList(loader=self)

from .operations.vm import VMListSizes
self.command_table['vm list-sizes'] = VMListSizes(loader=self)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods, unused-argument
from knack.log import get_logger

from ._util import import_aaz_by_profile

logger = get_logger(__name__)

_VM = import_aaz_by_profile("vm")


class VMListSizes(_VM.ListSizes):
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
args_schema = super()._build_arguments_schema(*args, **kwargs)
args_schema.location._id_part = None

return args_schema
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ def load_command_table(self, _):

from .operations.sig_image_definition import SigImageDefinitionUpdate
self.command_table['sig image-definition update'] = SigImageDefinitionUpdate(loader=self)

from .operations.vm import VMListSizes
self.command_table['vm list-sizes'] = VMListSizes(loader=self)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods, unused-argument
from knack.log import get_logger

from ._util import import_aaz_by_profile

logger = get_logger(__name__)

_VM = import_aaz_by_profile("vm")


class VMListSizes(_VM.ListSizes):
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
args_schema = super()._build_arguments_schema(*args, **kwargs)
args_schema.location._id_part = None

return args_schema
2 changes: 2 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ def load_command_table(self, _):
g.generic_update_command('update', getter_name='get_vm_to_update', setter_name='update_vm', setter_type=compute_custom, command_type=compute_custom, supports_no_wait=True, validator=process_vm_update_namespace)
g.wait_command('wait', getter_name='get_instance_view', getter_type=compute_custom)
g.custom_command('auto-shutdown', 'auto_shutdown_vm')
from .operations.vm import VMListSizes
self.command_table['vm list-sizes'] = VMListSizes(loader=self)

with self.command_group('vm', compute_vm_sdk, client_factory=cf_vm) as g:
g.custom_command('install-patches', 'install_vm_patches', supports_no_wait=True, min_api='2020-12-01')
Expand Down
19 changes: 19 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/operations/vm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods, unused-argument
from knack.log import get_logger

from ..aaz.latest.vm import ListSizes as _VMListSizes

logger = get_logger(__name__)


class VMListSizes(_VMListSizes):
@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
args_schema = super()._build_arguments_schema(*args, **kwargs)
args_schema.location._id_part = None

return args_schema
Loading

0 comments on commit a7b7b6f

Please sign in to comment.