Skip to content

Commit

Permalink
Revert "workaround api failures on loading environments"
Browse files Browse the repository at this point in the history
This reverts commit 71db906.

The workaround isn't needed. The reported failures was caused by
incorrect runbook.

Signed-off-by: Konstantin Olshanov <[email protected]>
  • Loading branch information
Konstantin Olshanov committed Apr 4, 2024
1 parent fb7831f commit 764632d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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")

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

0 comments on commit 764632d

Please sign in to comment.