Skip to content

Commit

Permalink
Merge branch 'Azure:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
frankqianms authored Oct 10, 2024
2 parents e6b30ef + 77f2ff5 commit ac58b53
Show file tree
Hide file tree
Showing 1,435 changed files with 722,803 additions and 168,543 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,5 @@
/src/mdp/ @ajaykn

/src/azext_gallery-service-artifact/ @rohitbhoopalam

/src/azext_durabletask/ @RyanLettieri
1 change: 1 addition & 0 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ disable=
subprocess-run-check,
super-with-arguments,
too-many-arguments,
too-many-positional-arguments,
too-many-function-args,
too-many-lines,
using-constant-test,
Expand Down
7 changes: 5 additions & 2 deletions scripts/ci/credscan/CredScanSuppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_compose_with_command_list.yaml",
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_compose_with_command_list_and_entrypoint.yaml",
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_compose_with_command_string.yaml",
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_compose_create_with_transport_mapping_arg.yaml"
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_compose_create_with_transport_mapping_arg.yaml",
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_session_code_interpreter_nodelts_registry_e2e.yaml"
],
"_justification": "Dummy resources' keys left during testing Microsoft.App (required for log-analytics to create managedEnvironments)"
},
Expand Down Expand Up @@ -286,7 +287,9 @@
"src\\staticwebapp\\azext_staticwebapp\\tests\\latest\\recordings\\test_staticwebapp_dbconnection_cosmosdb.yaml",
"src\\vmware\\azext_vmware\\tests\\latest\\recordings\\test_vmware_global_reach_connection.yaml",
"src\\workloads\\azext_workloads\\tests\\latest\\recordings\\test_workloads_svi.yaml",
"src\\workloads\\azext_workloads\\tests\\latest\\recordings\\test_workloads_svi_install.yaml"
"src\\workloads\\azext_workloads\\tests\\latest\\recordings\\test_workloads_svi_install.yaml",
"src\\oracle-database\\azext_oracle_database\\tests\\latest\\recordings\\test_oracledatabase_adbs.yaml",
"src\\storage-preview\\azext_storage_preview\\tests\\latest\\recordings\\test_storage_account_local_user.yaml"
],
"_justification": "Fake credentials for recordings reported by new version credential scanner."
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/release_version_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def get_next_version_segment_tag():
if VERSION_MAJOR_TAG in pr_label_list:
return VERSION_MAJOR_TAG
elif VERSION_MINOR_TAG in pr_label_list:
return pr_label_list
return VERSION_MINOR_TAG
elif VERSION_PATCH_TAG in pr_label_list:
return VERSION_PATCH_TAG
elif VERSION_PRE_TAG in pr_label_list:
Expand Down
2 changes: 1 addition & 1 deletion src/aem/azext_aem/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def verify_aem(cmd, resource_group_name, vm_name, wait_time_in_minutes=15, skip_
aem.verify(skip_storage_check, wait_time_in_minutes)


class EnhancedMonitoring(object):
class EnhancedMonitoring: # pylint: disable=too-many-instance-attributes
def __init__(self, cmd, resource_group, vm_name, vm_client,
storage_client, roles_client=None, skip_storage_analytics=None,
install_new_extension=None,
Expand Down
6,593 changes: 5,073 additions & 1,520 deletions src/aem/azext_aem/tests/latest/recordings/test_ExtensionDowngrade.yaml

Large diffs are not rendered by default.

6,669 changes: 5,119 additions & 1,550 deletions src/aem/azext_aem/tests/latest/recordings/test_ExtensionReinstall.yaml

Large diffs are not rendered by default.

5,222 changes: 4,348 additions & 874 deletions src/aem/azext_aem/tests/latest/recordings/test_ExtensionUpgrade.yaml

Large diffs are not rendered by default.

9,926 changes: 7,560 additions & 2,366 deletions src/aem/azext_aem/tests/latest/recordings/test_NewExtensionDiskAdd.yaml

Large diffs are not rendered by default.

8,352 changes: 3,629 additions & 4,723 deletions src/aem/azext_aem/tests/latest/recordings/test_NewExtensionMultiNic.yaml

Large diffs are not rendered by default.

10,297 changes: 7,966 additions & 2,331 deletions src/aem/azext_aem/tests/latest/recordings/test_NewExtensionUltraDisk.yaml

Large diffs are not rendered by default.

5,813 changes: 4,778 additions & 1,035 deletions src/aem/azext_aem/tests/latest/recordings/test_OldExtensionReinstall.yaml

Large diffs are not rendered by default.

5,519 changes: 4,448 additions & 1,071 deletions src/aem/azext_aem/tests/latest/recordings/test_WithSystemAssignedIdentity.yaml

Large diffs are not rendered by default.

7,156 changes: 5,618 additions & 1,538 deletions src/aem/azext_aem/tests/latest/recordings/test_WithUserAssignedIdentity.yaml

Large diffs are not rendered by default.

5,330 changes: 4,346 additions & 984 deletions src/aem/azext_aem/tests/latest/recordings/test_WithoutIdentity.yaml

Large diffs are not rendered by default.

4,663 changes: 3,936 additions & 727 deletions src/aem/azext_aem/tests/latest/recordings/test_vm_aem_configure.yaml

Large diffs are not rendered by default.

5,418 changes: 4,408 additions & 1,010 deletions src/aem/azext_aem/tests/latest/recordings/test_vm_aem_configure_v2.yaml

Large diffs are not rendered by default.

5,903 changes: 4,773 additions & 1,130 deletions src/aem/azext_aem/tests/latest/recordings/test_vm_aem_configure_v2_individual.yaml

Large diffs are not rendered by default.

5,152 changes: 4,273 additions & 879 deletions src/aem/azext_aem/tests/latest/recordings/test_vm_aem_configure_v2_proxy.yaml

Large diffs are not rendered by default.

86 changes: 65 additions & 21 deletions src/aem/azext_aem/tests/latest/test_aem_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ def test_WithUserAssignedIdentity(self, resource_group):
self.kwargs.update({
'vm': vm_name,
'ident': ident_name,
'vnet': 'vnet',
'subnet': 'subnet'
})
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image win2016datacenter --admin-username myadmin --admin-password thisisaTest!@')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image win2016datacenter --admin-username myadmin --admin-password thisisaTest!@ --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')
self.cmd('identity create -g {rg} -n {ident}')

with self.assertRaises(CLIError) as cm:
Expand Down Expand Up @@ -126,10 +129,13 @@ def test_WithoutIdentity(self, resource_group):

vm_name = 'vm1'
self.kwargs.update({
'vm': vm_name
'vm': vm_name,
'vnet': 'vnet',
'subnet': 'subnet'
})

self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image RedHat:RHEL:8.2:latest --generate-ssh-keys')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image RedHat:RHEL:8.2:latest --generate-ssh-keys --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')

with self.assertRaises(CLIError) as cm:
self.cmd('vm aem delete --verbose -g {rg} -n {vm}')
Expand All @@ -156,10 +162,13 @@ def test_WithSystemAssignedIdentity(self, resource_group):

vm_name = 'vm1'
self.kwargs.update({
'vm': vm_name
'vm': vm_name,
'vnet': 'vnet',
'subnet': 'subnet'
})

self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image RedHat:RHEL:7.8:latest --generate-ssh-keys')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image RedHat:RHEL:7.8:latest --generate-ssh-keys --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')

with self.assertRaises(CLIError) as cm:
self.cmd('vm aem delete --verbose -g {rg} -n {vm}')
Expand Down Expand Up @@ -189,10 +198,13 @@ def test_ExtensionReinstall(self, resource_group):

vm_name = 'vm1'
self.kwargs.update({
'vm': vm_name
'vm': vm_name,
'vnet': 'vnet',
'subnet': 'subnet'
})

self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image SUSE:sles-15-sp2:gen2:latest --generate-ssh-keys')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image SUSE:sles-15-sp2:gen2:latest --generate-ssh-keys --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')

with self.assertRaises(CLIError) as cm:
self.cmd('vm aem delete --verbose -g {rg} -n {vm}')
Expand All @@ -213,16 +225,20 @@ def test_ExtensionReinstall(self, resource_group):

self._assert_new_extension(self.IDENT_SYSTEM_ASSIGNED)

@AllowLargeResponse(size_kb=9999)
@ResourceGroupPreparer()
def test_OldExtensionReinstall(self, resource_group):
os.environ["AZURE_CLI_AEM_TEST"] = "test_OldExtensionReinstall"

vm_name = 'vm1'
self.kwargs.update({
'vm': vm_name
'vm': vm_name,
'vnet': 'vnet',
'subnet': 'subnet'
})

self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image win2016datacenter --admin-username myadmin --admin-password thisisaTest!@')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image win2016datacenter --admin-username myadmin --admin-password thisisaTest!@ --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')

with self.assertRaises(CLIError) as cm:
self.cmd('vm aem delete --verbose -g {rg} -n {vm}')
Expand Down Expand Up @@ -252,10 +268,13 @@ def test_ExtensionDowngrade(self, resource_group):

vm_name = 'vm1'
self.kwargs.update({
'vm': vm_name
'vm': vm_name,
'vnet': 'vnet',
'subnet': 'subnet'
})

self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image SUSE:sles-12-sp5:gen2:latest --generate-ssh-keys')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image SUSE:sles-12-sp5:gen2:latest --generate-ssh-keys --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')

with self.assertRaises(CLIError) as cm:
self.cmd('vm aem delete --verbose -g {rg} -n {vm}')
Expand All @@ -276,16 +295,20 @@ def test_ExtensionDowngrade(self, resource_group):

self._assert_new_extension(self.IDENT_SYSTEM_ASSIGNED)

@AllowLargeResponse(size_kb=9999)
@ResourceGroupPreparer()
def test_ExtensionUpgrade(self, resource_group):
os.environ["AZURE_CLI_AEM_TEST"] = "test_ExtensionUpgrade"

vm_name = 'vm1'
self.kwargs.update({
'vm': vm_name
'vm': vm_name,
'vnet': 'vnet',
'subnet': 'subnet'
})

self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image win2016datacenter --admin-username myadmin --admin-password thisisaTest!@')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image win2016datacenter --admin-username myadmin --admin-password thisisaTest!@ --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')

with self.assertRaises(CLIError) as cm:
self.cmd('vm aem delete --verbose -g {rg} -n {vm}')
Expand Down Expand Up @@ -315,10 +338,13 @@ def test_NewExtensionDiskAdd(self, resource_group):

vm_name = 'vm1'
self.kwargs.update({
'vm': vm_name
'vm': vm_name,
'vnet': 'vnet',
'subnet': 'subnet'
})

self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image win2016datacenter --admin-username myadmin --admin-password thisisaTest!@')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image win2016datacenter --admin-username myadmin --admin-password thisisaTest!@ --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')

with self.assertRaises(CLIError) as cm:
self.cmd('vm aem delete --verbose -g {rg} -n {vm}')
Expand Down Expand Up @@ -372,6 +398,8 @@ def test_NewExtensionMultiNic(self, resource_group):
self.cmd('network nic create -g {rg} --name {nic1} --vnet-name {vnet} --subnet {subnet1} --network-security-group {nsg}')
self.cmd('network nic create -g {rg} --name {nic2} --vnet-name {vnet} --subnet {subnet2} --network-security-group {nsg}')
self.cmd('vm create -g {rg} --name {vm} --os-disk-name os-disk --image SUSE:sles-12-sp5:gen2:latest --generate-ssh-keys --nics {nic1} {nic2}')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet1} --default-outbound-access false')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet2} --default-outbound-access false')

with self.assertRaises(CLIError) as cm:
self.cmd('vm aem delete --verbose -g {rg} -n {vm}')
Expand Down Expand Up @@ -410,10 +438,13 @@ def test_NewExtensionUltraDisk(self, resource_group):

vm_name = 'vm1'
self.kwargs.update({
'vm': vm_name
'vm': vm_name,
'vnet': 'vnet',
'subnet': 'subnet'
})

self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk -z 1 --size Standard_E2s_v3 --image win2016datacenter --admin-username myadmin --admin-password thisisaTest1234 --ultra-ssd-enabled')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk -z 1 --size Standard_E2s_v3 --image win2016datacenter --admin-username myadmin --admin-password thisisaTest1234 --ultra-ssd-enabled --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')

with self.assertRaises(CLIError) as cm:
self.cmd('vm aem delete --verbose -g {rg} -n {vm}')
Expand Down Expand Up @@ -688,14 +719,18 @@ def test_scope_method(self):
self.assertTrue(len(ok) == ok_count)
self.assertTrue(len(nok) == nok_count)

@AllowLargeResponse(size_kb=9999)
@ResourceGroupPreparer()
def test_vm_aem_configure(self, resource_group):
os.environ["AZURE_CLI_AEM_TEST"] = "test_vm_aem_configure"

self.kwargs.update({
'vm': 'vm1',
'vnet': 'vnet',
'subnet': 'subnet'
})
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image centos --generate-ssh-keys')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image SUSE:sles-12-sp5:gen2:latest --generate-ssh-keys --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')
self.cmd('vm aem set -g {rg} -n {vm} --verbose')
self.cmd('vm aem verify -g {rg} -n {vm} --verbose')
self.cmd('vm aem delete -g {rg} -n {vm} --verbose')
Expand All @@ -712,8 +747,11 @@ def test_vm_aem_configure_v2(self, resource_group):

self.kwargs.update({
'vm': 'vm1',
'vnet': 'vnet',
'subnet': 'subnet'
})
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image centos --generate-ssh-keys')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image SUSE:sles-12-sp5:gen2:latest --generate-ssh-keys --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')
self.cmd('vm aem set -g {rg} -n {vm} --install-new-extension --verbose')
self.cmd('vm aem verify -g {rg} -n {vm} --verbose')
self.cmd('vm aem delete -g {rg} -n {vm} --verbose')
Expand All @@ -730,8 +768,11 @@ def test_vm_aem_configure_v2_individual(self, resource_group):

self.kwargs.update({
'vm': 'vm1',
'vnet': 'vnet',
'subnet': 'subnet'
})
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image centos --generate-ssh-keys')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image SUSE:sles-12-sp5:gen2:latest --generate-ssh-keys --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')
self.cmd('vm aem set -g {rg} -n {vm} --install-new-extension --set-access-to-individual-resources --verbose')
self.cmd('vm aem verify -g {rg} -n {vm} --verbose')
self.cmd('vm aem delete -g {rg} -n {vm} --verbose')
Expand All @@ -747,8 +788,11 @@ def test_vm_aem_configure_v2_proxy(self, resource_group):

self.kwargs.update({
'vm': 'vm1',
'vnet': 'vnet',
'subnet': 'subnet'
})
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image centos --generate-ssh-keys')
self.cmd('vm create -g {rg} -n {vm} --os-disk-name os-disk --image SUSE:sles-12-sp5:gen2:latest --generate-ssh-keys --subnet {subnet} --vnet-name {vnet} --nsg-rule NONE')
self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet} -n {subnet} --default-outbound-access false')
self.cmd('vm aem set -g {rg} -n {vm} --install-new-extension --proxy-uri http://proxyhost:8080 --verbose')
self.cmd('vm aem verify -g {rg} -n {vm} --verbose')
self.cmd('vm aem delete -g {rg} -n {vm} --verbose')
Expand Down
26 changes: 25 additions & 1 deletion src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,32 @@ If there is no rush to release a new version, please just add a description of t

To release a new version, please select a new version number (usually plus 1 to last patch version, X.Y.Z -> Major.Minor.Patch, more details in `\doc <https://semver.org/>`_), and then add a new section named as the new version number in this file, the content should include the new modifications and everything from the *Pending* section. Finally, update the `VERSION` variable in `setup.py` with this new version number.

Pending
9.0.0b6
+++++++
* Print warning message when new node pool is created with SSH enabled, suggest to create SSH disabled node pool.

9.0.0b5
+++++++
* Add `--driver-type` to the `az aks nodepool add` command.

9.0.0b4
+++++++
* Set the --node-vm-size to empty string when the cluster sku name is automatic. The node vm size will pick from the candidate toggle based on the logic in automatic vm selection.
* Removed some features preview flag that automatic depends on in the test_aks_commands.py

9.0.0b3
+++++++
* Add `--undrainable-node-behavior` to the `az aks nodepool add/update/upgrade` commands.

9.0.0b2
+++++++
* Add block to supported outbound type
* Vendor new SDK and bump API version to 2024-07-02-preview.

9.0.0b1
+++++++
* [BREAKING CHANGE]: Remove support for `az aks update --ssh-access` command to avoid misleading. To update existing cluster's SSH access, please use `az aks nodepool update --ssh-access` to update node pool's SSH access one by one.
* Remove dependency on `msrestazure.azure_exceptions` and `msrestazure.tools`.

8.0.0b1
+++++++
Expand Down
5 changes: 4 additions & 1 deletion src/aks-preview/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ Released version and adopted API version
* - 7.0.0b3 ~ 7.0.0b3
- 2024-05-02-preview
-
* - 7.0.0b4 ~ latest
* - 7.0.0b4 ~ 9.0.0b1
- 2024-06-02-preview
-
* - 9.0.0b2 ~ latest
- 2024-07-02-preview
-
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"test_aks_disable_addon_gitops"
],
"gpu, no quota": [
"test_aks_nodepool_add_with_gpu_instance_profile"
"test_aks_nodepool_add_with_gpu_instance_profile",
"test_aks_gpu_driver_type"
],
"overlay migration, missing toggle": [
"test_aks_azure_cni_overlay_migration"
Expand Down
3 changes: 3 additions & 0 deletions src/aks-preview/azcli_aks_live_test/scripts/setup_venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ setupAZ(){
# fix the issue that vcrpy>=4.3.0 is not compatible with urllib3
pip install vcrpy==4.2.1

# fix the issue "Cannot import name 'AccessTokenInfo' from 'azure.core.credentials'"
pip install azure-identity==1.17.1

# post-install-az: check installation result
which az && az version
}
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/azext_aks_preview/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def register_aks_preview_resource_type():
register_resource_type(
"latest",
CUSTOM_MGMT_AKS_PREVIEW,
SDKProfile("2024-06-02-preview", {"container_services": "2017-07-01"}),
SDKProfile("2024-07-02-preview", {"container_services": "2017-07-01"}),
)


Expand Down
4 changes: 2 additions & 2 deletions src/aks-preview/azext_aks_preview/_completers.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ def _get_location(cli_ctx, namespace):

def _get_location_from_resource_group(cli_ctx, resource_group_name):
from azext_aks_preview._client_factory import get_resource_groups_client
from msrestazure.azure_exceptions import CloudError
from azure.core.exceptions import HttpResponseError

try:
rg = get_resource_groups_client(cli_ctx).get(resource_group_name)
return rg.location
except CloudError as err:
except HttpResponseError as err:
# Print a warning if the user hit [TAB] but the `--resource-group` argument was incorrect.
# For example: "Warning: Resource group 'bogus' could not be found."
from argcomplete import warn
Expand Down
6 changes: 5 additions & 1 deletion src/aks-preview/azext_aks_preview/_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

# vm size
CONST_DEFAULT_NODE_VM_SIZE = "Standard_DS2_v2"
CONST_DEFAULT_AUTOMATIC_SKU_NODE_VM_SIZE = "Standard_DS4_v2"
CONST_DEFAULT_WINDOWS_NODE_VM_SIZE = "Standard_D2s_v3"

# workload runtime
Expand Down Expand Up @@ -322,6 +321,7 @@
CONST_ARTIFACT_SOURCE_CACHE = "Cache"

CONST_OUTBOUND_TYPE_NONE = "none"
CONST_OUTBOUND_TYPE_BLOCK = "block"

# IMDS restriction consts
CONST_IMDS_RESTRICTION_ENABLED = "None"
Expand All @@ -330,3 +330,7 @@
# TLS Management Consts
CONST_TLS_MANAGEMENT_MANAGED = "Managed"
CONST_TLS_MANAGEMENT_NONE = "None"

# GPU Driver Type Consts
CONST_GPU_DRIVER_TYPE_CUDA = "CUDA"
CONST_GPU_DRIVER_TYPE_GRID = "GRID"
Loading

0 comments on commit ac58b53

Please sign in to comment.