-
Notifications
You must be signed in to change notification settings - Fork 1.6k
{SSH} Migrate commands calling Compute module to aaz-based implementation #9778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,19 +51,20 @@ def handle_target_os_type(cmd, op_info): | |||||||||
|
|
||||||||||
|
|
||||||||||
| def _get_azure_vm_os(cmd, resource_group_name, vm_name): | ||||||||||
| from azure.cli.core.commands import client_factory | ||||||||||
| from azure.cli.core import profiles | ||||||||||
| vm = None | ||||||||||
| from azure.cli.command_modules.vm.aaz.latest.vm import Show as VMShow | ||||||||||
| os_type = None | ||||||||||
| # pylint: disable=broad-except | ||||||||||
| try: | ||||||||||
| compute_client = client_factory.get_mgmt_service_client(cmd.cli_ctx, profiles.ResourceType.MGMT_COMPUTE) | ||||||||||
| vm = compute_client.virtual_machines.get(resource_group_name, vm_name) | ||||||||||
| command_args = { | ||||||||||
| 'resource_group': resource_group_name, | ||||||||||
| 'vm_name': vm_name | ||||||||||
| } | ||||||||||
| vm = VMShow(cli_ctx=cmd.cli_ctx)(command_args=command_args) | ||||||||||
| except Exception: | ||||||||||
| return None | ||||||||||
|
|
||||||||||
| if vm and vm.storage_profile and vm.storage_profile.os_disk and vm.storage_profile.os_disk.os_type: | ||||||||||
| os_type = vm.storage_profile.os_disk.os_type | ||||||||||
| if vm and vm.get('storageProfile', {}).get('osDisk', {}).get('osType'): | ||||||||||
| os_type = vm['storageProfile']['osDisk']['osType'] | ||||||||||
|
Comment on lines
+66
to
+67
|
||||||||||
| if vm and vm.get('storageProfile', {}).get('osDisk', {}).get('osType'): | |
| os_type = vm['storageProfile']['osDisk']['osType'] | |
| if vm: | |
| os_type = vm.get('storageProfile', {}).get('osDisk', {}).get('osType') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release note wording: consider hyphenating "AAZ-based" (compound modifier) for readability/consistency.