← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~smoser/cloud-init:bug/ds-identify-none-twice into cloud-init:master

 

Scott Moser has proposed merging ~smoser/cloud-init:bug/ds-identify-none-twice into cloud-init:master.

Commit message:
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.

Requested reviews:
  Dan Watkins (daniel-thewatkins)
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/321208
-- 
Your team cloud init development team is requested to review the proposed merge of ~smoser/cloud-init:bug/ds-identify-none-twice into cloud-init:master.
diff --git a/tools/ds-identify b/tools/ds-identify
index 3010634..54bd999 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
 }

References