Use get_ip function in place of give_me_numbers.
Remove give_me_numbers as it is no longer needed.
This commit is contained in:
parent
29770073b2
commit
e42c1eda15
@ -182,30 +182,3 @@ cgroup_device_acl = [
|
||||
EOF
|
||||
service libvirt-bin reload
|
||||
}
|
||||
|
||||
function give_me_numbers {
|
||||
local name="$1"
|
||||
local address=
|
||||
|
||||
case "$name" in
|
||||
[A-Za-z]*)
|
||||
address=$(getent hosts "$name" | awk '{print $1}')
|
||||
case "$address" in
|
||||
127.*)
|
||||
address=$(dig +short "$name")
|
||||
if [ -z "$address" ]; then
|
||||
echo "$name"
|
||||
fi
|
||||
echo "$address"
|
||||
;;
|
||||
*)
|
||||
echo "$address"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# not a name, maybe it's an address?
|
||||
echo "$name"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ function ceph_changed {
|
||||
MONS=`relation-list`
|
||||
mon_hosts=""
|
||||
for mon in $MONS; do
|
||||
mon_hosts="$mon_hosts $(give_me_numbers $(relation-get private-address $mon)):6789"
|
||||
mon_hosts="$mon_hosts $(get_ip $(relation-get private-address $mon)):6789"
|
||||
done
|
||||
cat > /etc/ceph/ceph.conf << EOF
|
||||
[global]
|
||||
|
Loading…
x
Reference in New Issue
Block a user