ceph_common.sh: sort -u to avoid extra operation

Use "sort -u" to remove the repeat of any mon/mds/mgr/osd
in case of double operation.

Signed-off-by: Ovidiu Poncea <ovidiu.poncea@windriver.com>
This commit is contained in:
Changcheng Liu 2019-05-10 14:09:45 +08:00
parent d613747554
commit 6746624cac

View File

@ -182,10 +182,14 @@ get_name_list() {
orig="$*"
# extract list of monitors, mdss, osds, mgrs defined in startup.conf
allconf="$local "`$CCONF -c $conf -l mon | egrep -v '^mon$' || true ; \
$CCONF -c $conf -l mds | egrep -v '^mds$' || true ; \
$CCONF -c $conf -l mgr | egrep -v '^mgr$' || true ; \
$CCONF -c $conf -l osd | egrep -v '^osd$' || true`
allconf=$(for entity in \
$local \
`$CCONF -c $conf -l mon | egrep -v '^mon$' || true` \
`$CCONF -c $conf -l mds | egrep -v '^mds$' || true` \
`$CCONF -c $conf -l mgr | egrep -v '^mgr$' || true` \
`$CCONF -c $conf -l osd | egrep -v '^osd$' || true`; do
echo $entity
done | sort -u)
if [ -z "$orig" ]; then
what="$allconf"