Merge lp:~smoser/ubuntu/maverick/cloud-init/lp942961-apt-pipeline into lp:ubuntu/maverick/cloud-init

Proposed by Scott Moser
Status: Merged
Merge reported by: Scott Moser
Merged at revision: not available
Proposed branch: lp:~smoser/ubuntu/maverick/cloud-init/lp942961-apt-pipeline
Merge into: lp:ubuntu/maverick/cloud-init
Diff against target: 150 lines (+104/-0)
6 files modified
.pc/applied-patches (+1/-0)
cloudinit/__init__.py (+1/-0)
debian/changelog (+9/-0)
debian/cloud-init.postinst (+14/-0)
debian/patches/lp948461-disable-add-configure-apt-pipelining.patch (+78/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~smoser/ubuntu/maverick/cloud-init/lp942961-apt-pipeline
Reviewer Review Type Date Requested Status
Ubuntu Development Team Pending
Review via email: mp+97494@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2010-09-16 04:28:55 +0000
+++ .pc/applied-patches 2012-03-14 19:23:20 +0000
@@ -1,1 +1,2 @@
1267-do-not-use-ec2-archive-in-vpc.patch1267-do-not-use-ec2-archive-in-vpc.patch
2lp948461-disable-add-configure-apt-pipelining.patch
23
=== modified file 'cloudinit/__init__.py'
--- cloudinit/__init__.py 2010-09-12 15:23:39 +0000
+++ cloudinit/__init__.py 2012-03-14 19:23:20 +0000
@@ -42,6 +42,7 @@
42 - ssh-import-id42 - ssh-import-id
43 - ssh43 - ssh
44 - grub-dpkg44 - grub-dpkg
45 - apt-pipelining
45 - apt-update-upgrade46 - apt-update-upgrade
46 - puppet47 - puppet
47 - updates-check48 - updates-check
4849
=== modified file 'debian/changelog'
--- debian/changelog 2010-09-16 04:28:55 +0000
+++ debian/changelog 2012-03-14 19:23:20 +0000
@@ -1,3 +1,12 @@
1cloud-init (0.5.15-0ubuntu3.1) UNRELEASED; urgency=low
2
3 * add ability to configure Acquire::http::Pipeline-Depth via
4 cloud-config setting 'apt_pipelining' (LP: #942061)
5 * debian/cloud-init.postinst: address population of apt_pipeline
6 setting on installation.
7
8 -- Scott Moser <smoser@ubuntu.com> Wed, 14 Mar 2012 14:09:44 -0400
9
1cloud-init (0.5.15-0ubuntu3) maverick; urgency=low10cloud-init (0.5.15-0ubuntu3) maverick; urgency=low
211
3 * do not use ec2 ubuntu archive if instance is VPC (LP: #615545)12 * do not use ec2 ubuntu archive if instance is VPC (LP: #615545)
413
=== modified file 'debian/cloud-init.postinst'
--- debian/cloud-init.postinst 2010-02-05 15:48:21 +0000
+++ debian/cloud-init.postinst 2012-03-14 19:23:20 +0000
@@ -6,6 +6,20 @@
6 # disable ureadahead (LP: #499520)6 # disable ureadahead (LP: #499520)
7 dpkg-divert --package cloud-init --rename --divert \7 dpkg-divert --package cloud-init --rename --divert \
8 /etc/init/ureadahead.conf.disabled --add /etc/init/ureadahead.conf8 /etc/init/ureadahead.conf.disabled --add /etc/init/ureadahead.conf
9
10 # we want to affect apt_pipelining on install, not wait for
11 # cloud-init to run it on next boot.
12 pipeline_f="/etc/apt/apt.conf.d/90cloud-init-pipelining"
13 if [ -f /var/lib/cloud/data/cache/obj.pkl ]; then
14 cloud-init-cfg apt-pipelining once-per-instance >/dev/null 2>&1 ||
15 echo "Warning: failed to setup apt-pipelining" 1>&2
16 elif [ ! -f "$pipeline_f" ]; then
17 # there was no cloud available, so populate it ourselves.
18 cat > "$pipeline_f" <<EOF
19//Written by cloud-init per 'apt_pipelining'
20Acquire::http::Pipeline-Depth "0";
21EOF
22 fi
9fi23fi
1024
11#DEBHELPER#25#DEBHELPER#
1226
=== added file 'debian/patches/lp948461-disable-add-configure-apt-pipelining.patch'
--- debian/patches/lp948461-disable-add-configure-apt-pipelining.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/lp948461-disable-add-configure-apt-pipelining.patch 2012-03-14 19:23:20 +0000
@@ -0,0 +1,78 @@
1Description: add support for configuring apt http pipelining
2 This allows the user to configure Acquire::http::Pipeline-Depth via
3 cloud-config syntax.
4 .
5 Changes to the debian packaging (cloud-init.postinst) ensure that
6 initially, the value will be set to '0' (different than its default value)
7 on installation of the package. For more information on why, please
8 see bug 948461.
9 .
10 This patch is pulled from the upstream cloud-init solution.
11Bug: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/948461
12Author: Scott Moser <smoser@ubuntu.com>
13--- a/cloudinit/__init__.py
14+++ b/cloudinit/__init__.py
15@@ -42,6 +42,7 @@ cloud_config_modules:
16 - ssh-import-id
17 - ssh
18 - grub-dpkg
19+ - apt-pipelining
20 - apt-update-upgrade
21 - puppet
22 - updates-check
23--- /dev/null
24+++ b/cloudinit/CloudConfig/cc_apt_pipelining.py
25@@ -0,0 +1,53 @@
26+# vi: ts=4 expandtab
27+#
28+# Copyright (C) 2011 Canonical Ltd.
29+#
30+# Author: Ben Howard <ben.howard@canonical.com>
31+#
32+# This program is free software: you can redistribute it and/or modify
33+# it under the terms of the GNU General Public License version 3, as
34+# published by the Free Software Foundation.
35+#
36+# This program is distributed in the hope that it will be useful,
37+# but WITHOUT ANY WARRANTY; without even the implied warranty of
38+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39+# GNU General Public License for more details.
40+#
41+# You should have received a copy of the GNU General Public License
42+# along with this program. If not, see <http://www.gnu.org/licenses/>.
43+
44+import cloudinit.util as util
45+from cloudinit.CloudConfig import per_instance
46+
47+frequency = per_instance
48+default_file = "/etc/apt/apt.conf.d/90cloud-init-pipelining"
49+
50+
51+def handle(_name, cfg, _cloud, log, _args):
52+
53+ apt_pipe_value = util.get_cfg_option_str(cfg, "apt_pipelining", False)
54+ apt_pipe_value = str(apt_pipe_value).lower()
55+
56+ if apt_pipe_value == "false":
57+ write_apt_snippet("0", log)
58+
59+ elif apt_pipe_value in ("none", "unchanged", "os"):
60+ return
61+
62+ elif apt_pipe_value in str(range(0, 6)):
63+ write_apt_snippet(apt_pipe_value, log)
64+
65+ else:
66+ log.warn("Invalid option for apt_pipeling: %s" % apt_pipe_value)
67+
68+
69+def write_apt_snippet(setting, log, f_name=default_file):
70+ """ Writes f_name with apt pipeline depth 'setting' """
71+
72+ acquire_pipeline_depth = 'Acquire::http::Pipeline-Depth "%s";\n'
73+ file_contents = ("//Written by cloud-init per 'apt_pipelining'\n"
74+ + (acquire_pipeline_depth % setting))
75+
76+ util.write_file(f_name, file_contents)
77+
78+ log.debug("Wrote %s with APT pipeline setting" % f_name)
079
=== modified file 'debian/patches/series'
--- debian/patches/series 2010-09-16 04:28:55 +0000
+++ debian/patches/series 2012-03-14 19:23:20 +0000
@@ -1,1 +1,2 @@
1267-do-not-use-ec2-archive-in-vpc.patch1267-do-not-use-ec2-archive-in-vpc.patch
2lp948461-disable-add-configure-apt-pipelining.patch

Subscribers

People subscribed via source and target branches

to all changes: