Skip to content

Commit

Permalink
Dont use ip tool to detect IPs
Browse files Browse the repository at this point in the history
Cassandra changed base image to image that don't have
iproute package installed.

Change-Id: I26489ecf7699e02486d8885b5827ef4e893bd22b
Partial-Bug: #1744439
  • Loading branch information
alexey-mr authored and Andrey-mp committed Feb 14, 2018
1 parent 17973db commit 6c986ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion containers/external/cassandra-init/contrail-entrypoint.sh
@@ -1,7 +1,7 @@
#!/bin/bash -e

IFS=',' read -ra srv_list <<< "$CASSANDRA_SEEDS"
local_ips=$(ip addr | awk '/inet/ {print($2)}')
local_ips=$(cat "/proc/net/fib_trie" | awk '/32 host/ { print f } {f=$2}')
for srv in "${srv_list[@]}"; do
if [[ "$local_ips" =~ "$srv" ]] ; then
echo "INFO: found '$srv' in local IPs '$local_ips'"
Expand Down
2 changes: 1 addition & 1 deletion containers/external/cassandra/contrail-entrypoint.sh
@@ -1,7 +1,7 @@
#!/bin/bash -e

IFS=',' read -ra srv_list <<< "$CASSANDRA_SEEDS"
local_ips=$(ip addr | awk '/inet/ {print($2)}')
local_ips=$(cat "/proc/net/fib_trie" | awk '/32 host/ { print f } {f=$2}')
for srv in "${srv_list[@]}"; do
if [[ "$local_ips" =~ "$srv" ]] ; then
echo "INFO: found '$srv' in local IPs '$local_ips'"
Expand Down
2 changes: 1 addition & 1 deletion containers/external/zookeeper-init/contrail-entrypoint.sh
Expand Up @@ -6,7 +6,7 @@ ZOOKEEPER_PORTS=${ZOOKEEPER_PORTS:-'2888:3888'}
ord=1
my_ord=0
IFS=',' read -ra srv_list <<< "$ZOOKEEPER_NODES"
local_ips=$(ip addr | awk '/inet/ {print($2)}')
local_ips=$(cat "/proc/net/fib_trie" | awk '/32 host/ { print f } {f=$2}')
zoo_servers=''
for srv in "${srv_list[@]}"; do
if [[ -z "$ZOO_SERVERS" ]] ; then
Expand Down
2 changes: 1 addition & 1 deletion containers/external/zookeeper/contrail-entrypoint.sh
Expand Up @@ -6,7 +6,7 @@ ZOOKEEPER_PORTS=${ZOOKEEPER_PORTS:-'2888:3888'}
ord=1
my_ord=0
IFS=',' read -ra srv_list <<< "$ZOOKEEPER_NODES"
local_ips=$(ip addr | awk '/inet/ {print($2)}')
local_ips=$(cat "/proc/net/fib_trie" | awk '/32 host/ { print f } {f=$2}')
zoo_servers=''
for srv in "${srv_list[@]}"; do
if [[ -z "$ZOO_SERVERS" ]] ; then
Expand Down

0 comments on commit 6c986ad

Please sign in to comment.