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
4 changes: 4 additions & 0 deletions src/appservice-kube/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
1.0.0b2
++++++
* Remove unused compute SDK client factory and completers

1.0.0b1
++++++
* Fix compatibility with newer Azure CLI App Service module versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ def cf_plans(cli_ctx, *_):
return web_client_factory(cli_ctx).app_service_plans


def cf_compute_service(cli_ctx, *_):
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_COMPUTE)


def cf_resource_groups(cli_ctx, subscription_id=None):
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES,
subscription_id=subscription_id).resource_groups
8 changes: 5 additions & 3 deletions src/appservice-kube/azext_appservice_kube/_completers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_vm_size_completion_list(cmd, prefix, namespace): # pylint: disable=un
"""Return the VM sizes returned by the Compute Service."""
location = _get_location(cmd.cli_ctx, namespace)
result = get_vm_sizes(cmd.cli_ctx, location)
return set(r.name for r in result)
return set(r.get('name') for r in result)


@Completer
Expand All @@ -25,8 +25,10 @@ def get_kube_sku_completion_list(cmd, prefix, namespace): # pylint: disable=un


def get_vm_sizes(cli_ctx, location):
from ._client_factory import cf_compute_service
return cf_compute_service(cli_ctx).virtual_machine_sizes.list(location)
from azure.cli.command_modules.vm.operations.vm import VMListSizes
return VMListSizes(cli_ctx=cli_ctx)(command_args={
'location': location
})


def _get_location(cli_ctx, namespace):
Expand Down
6 changes: 0 additions & 6 deletions src/appservice-kube/azext_appservice_kube/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,6 @@ def create_app_service_plan(cmd, resource_group_name, name, is_linux, hyper_v, p
tags, no_wait)


def get_vm_sizes(cli_ctx, location):
from ._client_factory import cf_compute_service

return cf_compute_service(cli_ctx).virtual_machine_sizes.list(location)


def _get_kube_env_from_custom_location(cmd, custom_location, resource_group):
kube_environment_id = ""
custom_location_name = custom_location
Expand Down
Loading
Loading