in ccmlib/cluster.py [0:0]
def get_seeds(self):
if self.cassandra_version() >= '4.0':
#They might be overriding the storage port config now
storage_port = self._config_options.get("storage_port")
storage_interfaces = [s.network_interfaces['storage'] for s in self.seeds if isinstance(s, Node)]
seeds = []
#Convert node storage interfaces to IP strings and maybe replace the port
for storage_interface in storage_interfaces:
port = storage_port if storage_port is not None else str(storage_interface[1])
if ":" in storage_interface[0]:
seeds.append("[" + storage_interface[0] + "]:" + port)
else:
seeds.append(storage_interface[0] + ":" + port)
#For seeds that are strings need to update the port in the string
for seed in [string for string in self.seeds if not isinstance(string, Node)]:
url = urlparse("http://" + seed)
if storage_port is not None:
seeds.append(url.hostname + ":" + str(storage_port))
else:
seeds.append(seed)
return seeds
else:
return [s.network_interfaces['storage'][0] if isinstance(s, Node) else s for s in self.seeds]