Change _runbook to runbook, because used public

This commit is contained in:
Chi Song 2021-05-05 11:03:44 -07:00 коммит произвёл Gustavo Lima Chaves
Родитель ac0d3f109c
Коммит 4e19421480
5 изменённых файлов: 13 добавлений и 13 удалений

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

@ -41,5 +41,5 @@ class Console(notifier.Notifier):
return [TestResultMessage, notifier.TestRunMessage]
def _initialize(self, *args: Any, **kwargs: Any) -> None:
runbook = cast(ConsoleSchema, self._runbook)
runbook = cast(ConsoleSchema, self.runbook)
self._log_level = runbook.log_level

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

@ -49,7 +49,7 @@ class Html(Notifier):
return HtmlSchema
def finalize(self) -> None:
runbook = cast(HtmlSchema, self._runbook)
runbook = cast(HtmlSchema, self.runbook)
self._log.info(f"report: {self._report_path}")
self._html_report.pytest_sessionfinish(session=self._session)
if runbook.auto_open:
@ -124,7 +124,7 @@ class Html(Notifier):
return [TestResultMessage, TestRunMessage]
def _initialize(self, *args: Any, **kwargs: Any) -> None:
runbook = cast(HtmlSchema, self._runbook)
runbook = cast(HtmlSchema, self.runbook)
self._config = Config.fromdictargs({"self_contained_html": True}, {})
self._session = pytest.Session.from_config(self._config)
self._report_path = constants.RUN_LOCAL_PATH / runbook.path

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

@ -497,8 +497,8 @@ class AzurePlatform(Platform):
f"as it's not created by this run."
)
elif (
self._runbook.keep_environment == schema.keep_env_keys.always.name
or self._runbook.keep_environment is True
self.runbook.keep_environment == schema.keep_env_keys.always.name
or self.runbook.keep_environment is True
):
log.info(
f"skipped to delete resource group: {resource_group_name}, "
@ -648,7 +648,7 @@ class AzurePlatform(Platform):
def _initialize(self, *args: Any, **kwargs: Any) -> None:
# set needed environment variables for authentication
azure_runbook: AzurePlatformSchema = self._runbook.get_extended_runbook(
azure_runbook: AzurePlatformSchema = self.runbook.get_extended_runbook(
AzurePlatformSchema
)
assert azure_runbook, "platform runbook cannot be empty"
@ -811,13 +811,13 @@ class AzurePlatform(Platform):
]
set_filtered_fields(self._azure_runbook, arm_parameters, copied_fields)
arm_parameters.admin_username = self._runbook.admin_username
if self._runbook.admin_private_key_file:
arm_parameters.admin_username = self.runbook.admin_username
if self.runbook.admin_private_key_file:
arm_parameters.admin_key_data = get_public_key_data(
self._runbook.admin_private_key_file
self.runbook.admin_private_key_file
)
else:
arm_parameters.admin_password = self._runbook.admin_password
arm_parameters.admin_password = self.runbook.admin_password
environment_context = get_environment_context(environment=environment)
arm_parameters.resource_group_name = environment_context.resource_group_name
@ -879,7 +879,7 @@ class AzurePlatform(Platform):
# ssh related information will be filled back once vm is created
node_context.username = arm_parameters.admin_username
node_context.password = arm_parameters.admin_password
node_context.private_key_file = self._runbook.admin_private_key_file
node_context.private_key_file = self.runbook.admin_private_key_file
log.info(f"vm setting: {azure_node_runbook}")

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

@ -68,7 +68,7 @@ class MockPlatform(Platform):
self._mock_runbook.wait_more_resource_error = wait_more_resource_error
def _initialize(self, *args: Any, **kwargs: Any) -> None:
self._mock_runbook: MockPlatformSchema = self._runbook.get_extended_runbook(
self._mock_runbook: MockPlatformSchema = self.runbook.get_extended_runbook(
MockPlatformSchema, constants.PLATFORM_MOCK
)

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

@ -12,7 +12,7 @@ from lisa.util.logger import get_logger
class BaseClassWithRunbookMixin(BaseClassMixin):
def __init__(self, runbook: Any, *args: Any, **kwargs: Any) -> None:
super().__init__()
self._runbook = runbook
self.runbook = runbook
@classmethod
def create_with_runbook(