Sometimes hostname can contain the '-' character.

This PR solves hostname parsing errors in mon-check.

Change-Id: I900c6827d0c40c181900fb49cc920c28c69f0daf
This commit is contained in:
Seungkyu Ahn 2018-06-22 08:14:30 +00:00
parent cc30691207
commit 33f491dbcf

View File

@ -25,7 +25,7 @@ function heath_check () {
SBASE=${CEPH_OSD_SOCKET_BASE:-ceph-mon}
SSUFFIX=${CEPH_SOCKET_SUFFIX:-asok}
MON_ID=$(ps auwwx | grep ceph-mon | grep -v "$1" | grep -v grep | sed 's/.*-i\ *//;s/\ *-.*//'|awk '{print $1}')
MON_ID=$(ps auwwx | grep ceph-mon | grep -v "$1" | grep -v grep | sed 's/.*-i\ //;s/\ .*//'|awk '{print $1}')
if [ -z "${MON_ID}" ]; then
if [[ ${K8S_HOST_NETWORK} -eq 0 ]]; then