diff options
author | Scott Moser <smoser@brickies.net> | 2017-03-28 14:27:33 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-03-29 17:01:56 -0400 |
commit | 32b21ee7245bf00d55f875506ffc149aad9bb546 (patch) | |
tree | 1b7bc114aac13c410bbb2f557e60632ff04e3f9b | |
parent | 0e2030ca7fe783ead06100c748f4714895461799 (diff) | |
download | vyos-cloud-init-32b21ee7245bf00d55f875506ffc149aad9bb546.tar.gz vyos-cloud-init-32b21ee7245bf00d55f875506ffc149aad9bb546.zip |
ds-identify: do not write None twice to datasource_list.
If the only the None datasource was listed in datasource_list, then
ds-identify would write a cloud.cfg witih:
datasource_list: [None, None]
The fix is to just append None if the list only has None.
-rwxr-xr-x | tools/ds-identify | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/ds-identify b/tools/ds-identify index 30106347..54bd9999 100755 --- a/tools/ds-identify +++ b/tools/ds-identify @@ -954,7 +954,9 @@ found() { shift fi # always write the None datasource last. - list="${list:+${list}, }None" + if [ "$list" != "None" ]; then + list="${list:+${list}, }None" + fi write_result "datasource_list: [ $list ]" "$@" return } |