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:
andrew.glen-young@canonical.com 2013-03-04 14:58:18 -05:00
parent 29770073b2
commit e42c1eda15
2 changed files with 1 additions and 28 deletions

View File

@ -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
}

View File

@ -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]