[#285] Change func search bucket nodes and remove old resolver bucket cnr
Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
parent
85c2707ec8
commit
eba782e7d2
2 changed files with 4 additions and 9 deletions
|
@ -327,13 +327,6 @@ def _parse_cid(output: str) -> str:
|
||||||
return splitted[1]
|
return splitted[1]
|
||||||
|
|
||||||
|
|
||||||
@reporter.step("Search container by name")
|
|
||||||
def search_container_by_name(name: str, node: ClusterNode):
|
|
||||||
resolver_cls = load_plugin("frostfs.testlib.bucket_cid_resolver", node.host.config.product)
|
|
||||||
resolver: BucketContainerResolver = resolver_cls()
|
|
||||||
return resolver.resolve(node, name)
|
|
||||||
|
|
||||||
|
|
||||||
@reporter.step("Search for nodes with a container")
|
@reporter.step("Search for nodes with a container")
|
||||||
def search_nodes_with_container(
|
def search_nodes_with_container(
|
||||||
wallet: WalletInfo,
|
wallet: WalletInfo,
|
||||||
|
|
|
@ -7,8 +7,9 @@ from dateutil.parser import parse
|
||||||
|
|
||||||
from frostfs_testlib import reporter
|
from frostfs_testlib import reporter
|
||||||
from frostfs_testlib.s3 import S3ClientWrapper, VersioningStatus
|
from frostfs_testlib.s3 import S3ClientWrapper, VersioningStatus
|
||||||
|
from frostfs_testlib.s3.interfaces import BucketContainerResolver
|
||||||
from frostfs_testlib.shell import Shell
|
from frostfs_testlib.shell import Shell
|
||||||
from frostfs_testlib.steps.cli.container import search_container_by_name, search_nodes_with_container
|
from frostfs_testlib.steps.cli.container import search_nodes_with_container
|
||||||
from frostfs_testlib.storage.cluster import Cluster, ClusterNode
|
from frostfs_testlib.storage.cluster import Cluster, ClusterNode
|
||||||
from frostfs_testlib.storage.dataclasses.wallet import WalletInfo
|
from frostfs_testlib.storage.dataclasses.wallet import WalletInfo
|
||||||
|
|
||||||
|
@ -175,10 +176,11 @@ def search_nodes_with_bucket(
|
||||||
wallet: WalletInfo,
|
wallet: WalletInfo,
|
||||||
shell: Shell,
|
shell: Shell,
|
||||||
endpoint: str,
|
endpoint: str,
|
||||||
|
bucket_container_resolver: BucketContainerResolver,
|
||||||
) -> list[ClusterNode]:
|
) -> list[ClusterNode]:
|
||||||
cid = None
|
cid = None
|
||||||
for cluster_node in cluster.cluster_nodes:
|
for cluster_node in cluster.cluster_nodes:
|
||||||
cid = search_container_by_name(name=bucket_name, node=cluster_node)
|
cid = bucket_container_resolver.resolve(cluster_node, bucket_name)
|
||||||
if cid:
|
if cid:
|
||||||
break
|
break
|
||||||
nodes_list = search_nodes_with_container(wallet=wallet, cid=cid, shell=shell, endpoint=endpoint, cluster=cluster)
|
nodes_list = search_nodes_with_container(wallet=wallet, cid=cid, shell=shell, endpoint=endpoint, cluster=cluster)
|
||||||
|
|
Loading…
Reference in a new issue