Skip to content
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

Revert "workaround api failures on loading environments" #3248

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
8 changes: 5 additions & 3 deletions lisa/sut_orchestrator/azure/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)
from azure.keyvault.secrets import SecretClient
from azure.mgmt.compute import ComputeManagementClient
from azure.mgmt.compute.models import VirtualMachine
from azure.mgmt.compute.models import NetworkProfile, VirtualMachine
from azure.mgmt.keyvault import KeyVaultManagementClient
from azure.mgmt.keyvault.models import (
AccessPolicyEntry,
Expand Down Expand Up @@ -102,6 +102,7 @@
AZURE_VIRTUAL_NETWORK_NAME = "lisa-virtualNetwork"
AZURE_SUBNET_PREFIX = "lisa-subnet-"


NIC_NAME_PATTERN = re.compile(r"Microsoft.Network/networkInterfaces/(.*)", re.M)
PATTERN_PUBLIC_IP_NAME = re.compile(
r"providers/Microsoft.Network/publicIPAddresses/(.*)", re.M
Expand Down Expand Up @@ -1737,8 +1738,9 @@ def get_primary_ip_addresses(
platform: "AzurePlatform", resource_group_name: str, vm: VirtualMachine
) -> Tuple[str, str]:
network_client = get_network_client(platform)

assert vm.network_profile, "no network profile found"
assert isinstance(
vm.network_profile, NetworkProfile
), f"actual: {type(vm.network_profile)}"
assert isinstance(
vm.network_profile.network_interfaces, List
), f"actual: {type(vm.network_profile.network_interfaces)}"
Expand Down
2 changes: 1 addition & 1 deletion lisa/sut_orchestrator/azure/platform_.py
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ def _parse_detail_errors(self, error: Any) -> List[str]:
def _load_vms(
self, resource_group_name: str, log: Logger
) -> Dict[str, VirtualMachine]:
compute_client = get_compute_client(self)
compute_client = get_compute_client(self, api_version="2020-06-01")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this API version also? @LiliDeng, please have a test, if latest Azure API works.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.


log.debug(f"listing vm in resource group {resource_group_name}")
vms_map: Dict[str, VirtualMachine] = {}
Expand Down
Loading