From 13673f8d2b815452aa22f8e3811e04481558a731 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 18 May 2017 13:19:14 -0400 Subject: fix tools/ds-identify to not write None twice. If the user configured: datasource_list: ["Ec2", "None"] then ds-identify would write datasource_list: ["Ec2", "None", "None"] which would break the logic to avoid warning. --- tools/ds-identify | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools/ds-identify') diff --git a/tools/ds-identify b/tools/ds-identify index aff26eb6..74d26537 100755 --- a/tools/ds-identify +++ b/tools/ds-identify @@ -963,10 +963,11 @@ found() { # do not pass an empty line through. shift fi - # always write the None datasource last. - if [ "$list" != "None" ]; then - list="${list:+${list}, }None" - fi + # if None is not already in the list, then add it last. + case " $list " in + *\ None,\ *|*\ None\ ) :;; + *) list=${list:+${list}, None};; + esac write_result "datasource_list: [ $list ]" "$@" return } -- cgit v1.2.3