From: Shangzhong Zhu Date: Wed, 19 Jul 2017 14:53:49 +0000 (+0800) Subject: ceph-disk: s/ceph_osd_mkfs/command_check_call/ X-Git-Tag: v12.1.2~135^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b339ef2507445fd390b6953275e6fb3a4667aa44;p=ceph-ci.git ceph-disk: s/ceph_osd_mkfs/command_check_call/ Fixes: http://tracker.ceph.com/issues/20685 Signed-off-by: Zhu Shangzhong --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index ae5267d38a0..d2db4f49e78 100755 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -3110,36 +3110,6 @@ class PrepareBluestoreData(PrepareData): write_one_line(path, 'type', 'bluestore') -# -# Temporary workaround: if ceph-osd --mkfs does not -# complete within 5 minutes, assume it is blocked -# because of http://tracker.ceph.com/issues/13522 -# and retry a few times. -# -# Remove this function calls with command_check_call -# when http://tracker.ceph.com/issues/13522 is fixed -# -def ceph_osd_mkfs(arguments): - timeout = _get_command_executable(['timeout']) - mkfs_ok = False - error = 'unknown error' - for delay in os.environ.get('CEPH_OSD_MKFS_DELAYS', - '300 300 300 300 300').split(): - try: - _check_output(timeout + [delay] + arguments) - mkfs_ok = True - break - except subprocess.CalledProcessError as e: - error = e.output - if e.returncode == 124: # timeout fired, retry - LOG.debug('%s timed out : %s (retry)' - % (str(arguments), error)) - else: - break - if not mkfs_ok: - raise Error('%s failed : %s' % (str(arguments), error)) - - def mkfs( path, cluster, @@ -3161,7 +3131,7 @@ def mkfs( osd_type = read_one_line(path, 'type') if osd_type == 'bluestore': - ceph_osd_mkfs( + command_check_call( [ 'ceph-osd', '--cluster', cluster, @@ -3175,7 +3145,7 @@ def mkfs( ], ) elif osd_type == 'filestore': - ceph_osd_mkfs( + command_check_call( [ 'ceph-osd', '--cluster', cluster, diff --git a/src/ceph-disk/tests/ceph-disk.sh b/src/ceph-disk/tests/ceph-disk.sh index f96a9e06d08..54d6017879e 100755 --- a/src/ceph-disk/tests/ceph-disk.sh +++ b/src/ceph-disk/tests/ceph-disk.sh @@ -382,33 +382,6 @@ function test_keyring_path() { grep --quiet "keyring $dir/bootstrap-osd/ceph.keyring" $dir/test_keyring || return 1 } -# http://tracker.ceph.com/issues/13522 -function ceph_osd_fail_once_fixture() { - local dir=$1 - local command=ceph-osd - local fpath=`readlink -f $(which $command)` - [ "$fpath" = `readlink -f $CEPH_BIN/$command` ] || [ "$fpath" = `readlink -f $(pwd)/$command` ] || return 1 - - cat > $dir/$command <