From 2851cda6447038e87ae19a853f10056e0b3ce99b Mon Sep 17 00:00:00 2001 From: Yaroslav Dynnikov Date: Mon, 24 Nov 2025 17:49:11 +0300 Subject: [PATCH] Fix ydb/tests to conform py2 syntax --- ydb/tests/library/clients/kikimr_client.py | 20 ++++++++++---------- ydb/tests/library/harness/kikimr_runner.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ydb/tests/library/clients/kikimr_client.py b/ydb/tests/library/clients/kikimr_client.py index 52be138fdb6d..2bb3772bbe01 100644 --- a/ydb/tests/library/clients/kikimr_client.py +++ b/ydb/tests/library/clients/kikimr_client.py @@ -306,10 +306,10 @@ def read_host_configs(self, domain=1): response = self.send(request, 'BlobStorageConfig').BlobStorageConfigResponse if not response.Success: - raise RuntimeError(f'read_host_config request failed: {response.ErrorDescription}') + raise RuntimeError('read_host_config request failed: %s' % response.ErrorDescription) status = response.Status[0] if not status.Success: - raise RuntimeError(f'read_host_config has failed status: {status.ErrorDescription}') + raise RuntimeError('read_host_config has failed status: %s' % status.ErrorDescription) return status.HostConfig @@ -321,10 +321,10 @@ def define_host_configs(self, host_configs, domain=1): response = self.send(request, 'BlobStorageConfig').BlobStorageConfigResponse if not response.Success: - raise RuntimeError(f'define_host_config request failed: {response.ErrorDescription}') + raise RuntimeError('define_host_config request failed: %s' % response.ErrorDescription) for i, status in enumerate(response.Status): if not status.Success: - raise RuntimeError(f'define_host_config has failed status[{i}]: {status}') + raise RuntimeError('define_host_config has failed status[%d]: %s' % (i, status)) def read_storage_pools(self, domain=1): request = msgbus.TBlobStorageConfigRequest() @@ -334,11 +334,11 @@ def read_storage_pools(self, domain=1): response = self.send(request, 'BlobStorageConfig').BlobStorageConfigResponse if not response.Success: - raise RuntimeError(f'read_storage_pools request failed: {response.ErrorDescription}') + raise RuntimeError('read_storage_pools request failed: %s' % response.ErrorDescription) status = response.Status[0] if not status.Success: - raise RuntimeError(f'read_storage_pools has failed status: {status.ErrorDescription}') + raise RuntimeError('read_storage_pools has failed status: %s' % status.ErrorDescription) return status.StoragePool @@ -360,10 +360,10 @@ def pdisk_set_all_active(self, pdisk_path=None, domain=1): response = self.send(request, 'BlobStorageConfig').BlobStorageConfigResponse if not response.Success: - raise RuntimeError(f'update_all_drive_status_active request failed: {response.ErrorDescription}') + raise RuntimeError('update_all_drive_status_active request failed: %s' % response.ErrorDescription) for i, status in enumerate(response.Status): if not status.Success: - raise RuntimeError(f'update_all_drive_status_active has failed status[{i}]: {status}') + raise RuntimeError('update_all_drive_status_active has failed status[%d]: %s' % (i, status)) def query_base_config(self, domain=1): request = msgbus.TBlobStorageConfigRequest() @@ -375,11 +375,11 @@ def query_base_config(self, domain=1): response = self.send(request, 'BlobStorageConfig').BlobStorageConfigResponse if not response.Success: - raise RuntimeError(f'query_base_config failed: {response.ErrorDescription}') + raise RuntimeError('query_base_config failed: %s' % response.ErrorDescription) status = response.Status[0] if not status.Success: - raise RuntimeError(f'query_base_config failed: {status.ErrorDescription}') + raise RuntimeError('query_base_config failed: %s' % status.ErrorDescription) return status diff --git a/ydb/tests/library/harness/kikimr_runner.py b/ydb/tests/library/harness/kikimr_runner.py index e9f475168cd2..901499c79032 100644 --- a/ydb/tests/library/harness/kikimr_runner.py +++ b/ydb/tests/library/harness/kikimr_runner.py @@ -822,7 +822,7 @@ def __add_bs_box(self): if key == 'expected_slot_count': drive_proto.PDiskConfig.ExpectedSlotCount = value else: - raise KeyError(f"unknown pdisk_config option {key}") + raise KeyError("unknown pdisk_config option %s" % key) cmd = request.Command.add() cmd.DefineBox.BoxId = 1