Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ def _verify_password_with_ex(self, admin_password, is_linux, expected_err):

@staticmethod
def _get_compute_model(model_type, api_version=None):
from azure.cli.core.profiles._shared import AZURE_API_PROFILES, ResourceType
# With azure-mgmt-compute 34.1.0+, models are imported directly from azure.mgmt.compute.models
# instead of versioned paths like azure.mgmt.compute.v2024_11_01.models
from importlib import import_module

if api_version is None:
api_version = AZURE_API_PROFILES['latest'][ResourceType.MGMT_COMPUTE].default_api_version
api_version = "v" + api_version.replace("-", "_")
result = getattr(import_module('azure.mgmt.compute.{}.models'.format(api_version)), model_type)

result = getattr(import_module('azure.mgmt.compute.models'), model_type)
return result

def test_generate_specfied_ssh_key_files(self):
Expand Down
Loading