- local layer=${1:-mdd}
- local stripe_count=${2:-0}
- local mds=$(facet_host $SINGLEMDS)
- local rc=0
-
- rm -f ${TMP}/mds_survey*
-
- local target=$(get_target)
- local cmd="file_count=$file_count thrlo=$thrlo thrhi=$thrhi"
- local cmd+=" dir_count=$dir_count layer=$layer stripe_count=$stripe_count"
- local cmd+=" rslt_loc=${TMP} targets=\"$mds:$target\" $MDSSURVEY"
-
- echo + $cmd
- eval $cmd || rc=$?
- cat ${TMP}/mds_survey*
- rm -f ${TMP}/mds_survey*
- ((rc == 0)) || error "mds-survey failed"
+ local layer=${1:-mdd}
+ local stripe_count=${2:-0}
+ local rc=0
+
+ rm -f ${TMP}/mds_survey*
+
+ local cmd="file_count=$file_count thrlo=$thrlo thrhi=$thrhi"
+ cmd+=" dir_count=$dir_count layer=$layer stripe_count=$stripe_count"
+ cmd+=" rslt_loc=${TMP} targets=\"$(get_targets)\" $MDSSURVEY"
+
+ trap cleanup_echo_devs EXIT ERR
+
+ echo + $cmd
+ eval $cmd || rc=$?
+ cat ${TMP}/mds_survey*
+ rm -f ${TMP}/mds_survey*
+ ((rc == 0)) || error "mds-survey failed"