File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -178,12 +178,17 @@ list_cassandra_nodes() {
178178
179179translate_ipaddresses_to_docker_container_ids () {
180180 declare -a container_ids
181- for host in ${cassandraNodes} ; do
182- for container_id in $( docker ps -q) ; do
183- if docker inspect " $container_id " | grep -q " IPAddress\" : \" ${host} " ; then
184- container_ids+=(" ${container_id} " )
185- break
186- fi
181+ docker_containers=$( docker ps -q)
182+ declare -a container_inspects
183+ for container_id in ${docker_containers} ; do
184+ container_inspects+=(" $( docker inspect " $container_id " ) " )
185+ done
186+ for i in ${# docker_containers[@]} ; do
187+ for host in ${cassandraNodes} ; do
188+ if echo ${container_inspects[i]} | grep -q " IPAddress\" : \" ${host} " ; then
189+ container_ids+=(" ${docker_containers[i]} " )
190+ break
191+ fi
187192 done
188193 done
189194 cassandraNodes=" ${container_ids[*]} "
You can’t perform that action at this time.
0 commit comments