tests: Reducing commands in get_num_active_clean()

get_num_active_clean() is called very often but spawn 1 useless process.
The current "grep -v | wc -l" can be easily replaced by "grep -cv" which
do the same while spawning one process less.

Signed-off-by: Erwan Velu <erwan@redhat.com>
This commit is contained in:
Erwan Velu 2016-03-21 11:16:12 +01:00
parent d8f07c3ff6
commit b3f7392d9d

View File

@ -940,7 +940,7 @@ function get_num_active_clean() {
# grep -v '^$'
ceph --format xml pg dump pgs 2>/dev/null | \
$XMLSTARLET sel -t -m "//pg_stat/state[$expression]" -v . -n | \
grep -v '^$' | wc -l
grep -cv '^$'
}
function test_get_num_active_clean() {