common/rc: Fix check for SCRATCH_DEV_POOL presence in _scratch_dev_pool_get
authorNikolay Borisov <nborisov@suse.com>
Mon, 1 Nov 2021 13:56:58 +0000 (15:56 +0200)
committerEryu Guan <guaneryu@gmail.com>
Sun, 7 Nov 2021 12:54:26 +0000 (20:54 +0800)
commit955e0660288c50b4ce5eb9a80b4eb6b19b62d75a
treed6e45c00cf38a0b768b7fda832f5610008869af4
parentf67dd9d11c536a910e2ea2490048dc1cd37536ff
common/rc: Fix check for SCRATCH_DEV_POOL presence in _scratch_dev_pool_get

Current check is buggy because it can never trigger as even if
SCRATCH_DEV_POOL is not defined config_ndevs will get a value of 0
from 'wc -w', this in turn makes 'typeset -p config_ndevs' always
return 0, triggering the existing check a noop.

Fix this by explicitly checking for the presence of SCHRATC_DEV_POOL

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc