forked from TrueCloudLab/frostfs-testlib
New methods with nodes
Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
parent
e9777b63cd
commit
26a78c0eae
10 changed files with 170 additions and 10 deletions
|
@ -2,9 +2,11 @@ import random
|
|||
import re
|
||||
|
||||
import yaml
|
||||
from yarl import URL
|
||||
|
||||
from frostfs_testlib.hosting import Host, Hosting
|
||||
from frostfs_testlib.hosting.config import ServiceConfig
|
||||
from frostfs_testlib.reporter import get_reporter
|
||||
from frostfs_testlib.storage import get_service_registry
|
||||
from frostfs_testlib.storage.constants import ConfigAttributes
|
||||
from frostfs_testlib.storage.dataclasses.frostfs_services import (
|
||||
|
@ -17,6 +19,8 @@ from frostfs_testlib.storage.dataclasses.frostfs_services import (
|
|||
from frostfs_testlib.storage.dataclasses.node_base import NodeBase, ServiceClass
|
||||
from frostfs_testlib.storage.service_registry import ServiceRegistry
|
||||
|
||||
reporter = get_reporter()
|
||||
|
||||
|
||||
class ClusterNode:
|
||||
"""
|
||||
|
@ -250,3 +254,10 @@ class Cluster:
|
|||
def get_morph_endpoints(self) -> list[str]:
|
||||
nodes: list[MorphChain] = self.services(MorphChain)
|
||||
return [node.get_endpoint() for node in nodes]
|
||||
|
||||
def get_nodes_by_ip(self, ips: list[str]) -> list[ClusterNode]:
|
||||
cluster_nodes = [
|
||||
node for node in self.cluster_nodes if URL(node.morph_chain.get_endpoint()).host in ips
|
||||
]
|
||||
with reporter.step(f"Return cluster nodes - {cluster_nodes}"):
|
||||
return cluster_nodes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue