Skip to content

Commit 64963e6

Browse files
kamalcaLiliDeng
authored andcommitted
Azure Update VM Capabilities: Add Location
If the capabilities dictionary is empty for any reason, the hook implementation would have no way to know which region is being queried.
1 parent 0d56763 commit 64963e6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lisa/sut_orchestrator/azure/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def azure_update_arm_template(
3737

3838
@hookspec
3939
def azure_update_vm_capabilities(
40-
self, capabilities: Dict[str, AzureCapability]
40+
self, location: str, capabilities: Dict[str, AzureCapability]
4141
) -> None:
4242
"""
4343
Implement it to update the vm capabilities.

lisa/sut_orchestrator/azure/platform_.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,9 @@ def get_location_info(self, location: str, log: Logger) -> AzureLocation:
11341134
except Exception as e:
11351135
log.error(f"unknown sku: {sku_obj}")
11361136
raise e
1137-
plugin_manager.hook.azure_update_vm_capabilities(capabilities=all_skus)
1137+
plugin_manager.hook.azure_update_vm_capabilities(
1138+
location=location, capabilities=all_skus
1139+
)
11381140
location_data = AzureLocation(location=location, capabilities=all_skus)
11391141
log.debug(f"{location}: saving to disk")
11401142
with open(cached_file_name, "w") as f:

0 commit comments

Comments
 (0)