Merge ~raharper/cloud-init:ubuntu/devel/fix-90-dpkg-cfg into cloud-init:ubuntu/devel

Proposed by Ryan Harper
Status: Merged
Merged at revision: 92242430b5e77a42228f9594311ea362f8c417c1
Proposed branch: ~raharper/cloud-init:ubuntu/devel/fix-90-dpkg-cfg
Merge into: cloud-init:ubuntu/devel
Diff against target: 29 lines (+8/-2)
2 files modified
debian/changelog (+7/-0)
debian/cloud-init.config (+1/-2)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Needs Fixing
Dan Watkins Approve
Chad Smith Approve
Review via email: mp+373920@code.launchpad.net

Commit message

debian/cloud-init.config get_yaml_list should return only the value

When fixing LP #1841697 we mistakenly added the key and list brackets
to the return value of the get_yaml_list function. This resulted in
cloud-init.postinst which creates 90_dpkg.cfg to duplicate the key
and brackets resulting in an invalid yaml file. This commit removes
the emitted $key and [ ] portions resulting in valid yaml when
cloud-init.postinst renders 90_dpkg.cfg.

LP: #1846511

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:bc88f2ca66d982de720a55b31c13335074a72ed6
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1202/
Executed test runs:
    FAILED: Checkout

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1202//rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Dan Watkins (oddbloke) :
review: Approve
Revision history for this message
Chad Smith (chad.smith) wrote :

+1 validated both failure mode and fix. Also could test this fix directly applying and reverting this patch to /var/lib/dpkg/info/cloud-init.config and running dpkg-reconfigure --frontend=noninteractive cloud-init

Revision history for this message
Chad Smith (chad.smith) :
review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:bc88f2ca66d982de720a55b31c13335074a72ed6
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1203/
Executed test runs:
    SUCCESS: Checkout
    FAILED: Unit & Style Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1203//rebuild

review: Needs Fixing (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 :

FAILED: Continuous integration, rev:92242430b5e77a42228f9594311ea362f8c417c1
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1204/
Executed test runs:
    SUCCESS: Checkout
    FAILED: Unit & Style Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1204//rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:92242430b5e77a42228f9594311ea362f8c417c1
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1205/
Executed test runs:
    SUCCESS: Checkout
    FAILED: Unit & Style Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1205//rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index cfe1e0f..41e806b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+cloud-init (19.2-36-g059d049c-0ubuntu3) eoan; urgency=medium
7+
8+ * debian/cloud-init.config get_yaml_list should return only the value
9+ (LP: #1846511)
10+
11+ -- Ryan Harper <ryan.harper@canonical.com> Wed, 09 Oct 2019 16:32:17 -0500
12+
13 cloud-init (19.2-36-g059d049c-0ubuntu2) eoan; urgency=medium
14
15 * cherry-pick a7d8d032: get_interfaces: don't exclude bridge and bond
16diff --git a/debian/cloud-init.config b/debian/cloud-init.config
17index af38ffb..aacb1bf 100644
18--- a/debian/cloud-init.config
19+++ b/debian/cloud-init.config
20@@ -37,9 +37,8 @@ get_yaml_list() {
21 [ -f "$file" ] || return 1
22 # strip all whitespace, delete lines not matching key:,
23 # strip key: and [] and replace ',' with ', '
24- LISTVAL="$(sed -e "s/\s//g" -e "/^$key:/"'!'d \
25+ RET="$(sed -e "s/\s//g" -e "/^$key:/"'!'d \
26 -e "s/$key:\[//" -e "s/]//" -e "s/,/, /g" "$file")"
27- RET="$key: [ ${LISTVAL} ]"
28 [ -n "$RET" ] || RET="$default"
29 }
30

Subscribers

People subscribed via source and target branches