Skip to content

Commit

Permalink
tests: Port VM active broker helper fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Batalex committed Dec 9, 2024
1 parent b4adbe2 commit 192d9f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import subprocess
from pathlib import Path
from subprocess import PIPE, CalledProcessError, check_output
from typing import Any, Dict, List, Optional, Set
from typing import Any, List, Optional, Set

import yaml
from charms.kafka.client import KafkaClient
Expand Down Expand Up @@ -485,7 +485,7 @@ def get_provider_data(
return provider_relation_data | user_secret | tls_secret


def get_active_brokers(config: Dict) -> Set[str]:
def get_active_brokers(config: dict[str, str]) -> set[str]:
"""Gets all brokers currently connected to ZooKeeper.
Args:
Expand All @@ -495,9 +495,9 @@ def get_active_brokers(config: Dict) -> Set[str]:
Set of active broker ids
"""
chroot = config.get("database", config.get("chroot", ""))
hosts = config.get("endpoints", "").split(",")
username = config.get("username", "")
password = config.get("password", "")
hosts = [host.split(":")[0] for host in config.get("endpoints", "").split(",")]

zk = ZooKeeperManager(hosts=hosts, username=username, password=password)
path = f"{chroot}/brokers/ids/"
Expand Down

0 comments on commit 192d9f2

Please sign in to comment.