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

Proposed by Scott Moser
Status: Merged
Merged at revision: 32b21ee7245bf00d55f875506ffc149aad9bb546
Proposed branch: ~smoser/cloud-init:bug/ds-identify-none-twice
Merge into: cloud-init:master
Diff against target: 15 lines (+3/-1)
1 file modified
tools/ds-identify (+3/-1)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Needs Fixing
Dan Watkins Approve
cloud-init Commiters Pending
Review via email: mp+321208@code.launchpad.net

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.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Dan Watkins (oddbloke) :
review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tools/ds-identify b/tools/ds-identify
2index 3010634..54bd999 100755
3--- a/tools/ds-identify
4+++ b/tools/ds-identify
5@@ -954,7 +954,9 @@ found() {
6 shift
7 fi
8 # always write the None datasource last.
9- list="${list:+${list}, }None"
10+ if [ "$list" != "None" ]; then
11+ list="${list:+${list}, }None"
12+ fi
13 write_result "datasource_list: [ $list ]" "$@"
14 return
15 }

Subscribers

People subscribed via source and target branches