feature: rename check_supported to create_setting

This commit is contained in:
Chi Song 2022-08-04 14:16:58 -07:00 коммит произвёл Chi Song
Родитель 70d51489c6
Коммит 5c98549ab3
4 изменённых файлов: 4 добавлений и 15 удалений

Просмотреть файл

@ -77,11 +77,12 @@ class Feature(InitializableMixin):
...
@classmethod
def check_supported(
def create_setting(
cls, *args: Any, **kwargs: Any
) -> Optional[schema.FeatureSettings]:
"""
It's called in platform to check if a node support the feature or not.
If it's supported, create a setting.
"""
return None

Просмотреть файл

@ -1,9 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Any, Optional
from lisa import schema
from lisa.feature import Feature
FEATURE_NAME_ISOLATED_RESOURCE = "isolated_resource"
@ -25,12 +22,3 @@ class IsolatedResource(Feature):
def enabled(self) -> bool:
return True
@classmethod
def check_supported(
cls, *args: Any, **kwargs: Any
) -> Optional[schema.FeatureSettings]:
"""
It's called in platform to check if a node support the feature or not.
"""
return None

Просмотреть файл

@ -1374,7 +1374,7 @@ class IsolatedResource(AzureFeatureMixin, features.IsolatedResource):
)
@classmethod
def check_supported(
def create_setting(
cls, *args: Any, **kwargs: Any
) -> Optional[schema.FeatureSettings]:
resource_sku: Any = kwargs.get("resource_sku")

Просмотреть файл

@ -1577,7 +1577,7 @@ class AzurePlatform(Platform):
# handled by node_space directly.
continue
feature_setting = supported_feature.check_supported(
feature_setting = supported_feature.create_setting(
raw_capabilities=azure_raw_capabilities, resource_sku=resource_sku
)
if feature_setting: