Merge lp:~cjwatson/launchpad-buildd/rename-slave-config-section into lp:launchpad-buildd

Proposed by Colin Watson
Status: Rejected
Rejected by: Colin Watson
Proposed branch: lp:~cjwatson/launchpad-buildd/rename-slave-config-section
Merge into: lp:launchpad-buildd
Diff against target: 148 lines (+29/-10)
8 files modified
debian/changelog (+6/-0)
debian/upgrade-config (+14/-1)
lpbuildd/buildd-slave.tac (+2/-2)
lpbuildd/builder.py (+3/-3)
lpbuildd/debian.py (+1/-1)
lpbuildd/tests/buildd-slave-test.conf (+1/-1)
lpbuildd/tests/harness.py (+1/-1)
template-buildd-slave.conf (+1/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad-buildd/rename-slave-config-section
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+373354@code.launchpad.net

Commit message

Rename [slave] configuration section to [builder].

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Unmerged revisions

392. By Colin Watson

Rename [slave] configuration section to [builder].

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2019-08-23 09:58:21 +0000
3+++ debian/changelog 2019-09-27 22:28:16 +0000
4@@ -1,3 +1,9 @@
5+launchpad-buildd (178) UNRELEASED; urgency=medium
6+
7+ * Rename [slave] configuration section to [builder].
8+
9+ -- Colin Watson <cjwatson@ubuntu.com> Fri, 27 Sep 2019 23:26:30 +0100
10+
11 launchpad-buildd (177) xenial; urgency=medium
12
13 * Fix recipe building to not rely on /CurrentlyBuilding existing in base
14
15=== modified file 'debian/upgrade-config'
16--- debian/upgrade-config 2018-06-07 16:23:43 +0000
17+++ debian/upgrade-config 2019-09-27 22:28:16 +0000
18@@ -1,6 +1,6 @@
19 #!/usr/bin/python
20 #
21-# Copyright 2009, 2010, 2011 Canonical Ltd. This software is licensed under the
22+# Copyright 2009-2019 Canonical Ltd. This software is licensed under the
23 # GNU Affero General Public License version 3 (see the file LICENSE).
24
25 """Upgrade a launchpad-buildd configuration file."""
26@@ -208,6 +208,17 @@
27 "\n[snapmanager]\n"
28 "proxyport = 8222\n")
29
30+def upgrade_to_178():
31+ print("Upgrading %s to version 178" % conf_file)
32+ os.rename(conf_file, conf_file + "-prev178~")
33+
34+ with open(conf_file + "-prev178~", "r") as in_file:
35+ with open(conf_file, "w") as out_file:
36+ for line in in_file:
37+ if line.strip() == "[slave]":
38+ line = "[builder]\n"
39+ out_file.write(line)
40+
41 if __name__ == "__main__":
42 old_version = re.sub(r'[~-].*', '', old_version)
43 if apt_pkg.version_compare(old_version, "12") < 0:
44@@ -236,3 +247,5 @@
45 upgrade_to_127()
46 if apt_pkg.version_compare(old_version, "162") < 0:
47 upgrade_to_162()
48+ if apt_pkg.version_compare(old_version, "178") < 0:
49+ upgrade_to_178()
50
51=== modified file 'lpbuildd/buildd-slave.tac'
52--- lpbuildd/buildd-slave.tac 2019-02-12 10:35:12 +0000
53+++ lpbuildd/buildd-slave.tac 2019-09-27 22:28:16 +0000
54@@ -54,10 +54,10 @@
55
56 root = resource.Resource()
57 root.putChild('rpc', builder)
58-root.putChild('filecache', static.File(conf.get('slave', 'filecache')))
59+root.putChild('filecache', static.File(conf.get('builder', 'filecache')))
60 buildersite = server.Site(root)
61
62-strports.service("tcp:%s" % builder.builder._config.get("slave", "bindport"),
63+strports.service("tcp:%s" % builder.builder._config.get("builder", "bindport"),
64 buildersite).setServiceParent(builderService)
65
66 # You can interact with a running builder like this:
67
68=== modified file 'lpbuildd/builder.py'
69--- lpbuildd/builder.py 2019-09-27 22:14:50 +0000
70+++ lpbuildd/builder.py 2019-09-27 22:28:16 +0000
71@@ -137,7 +137,7 @@
72 if reactor is None:
73 reactor = default_reactor
74 self._reactor = reactor
75- self._sharepath = builder._config.get("slave", "sharepath")
76+ self._sharepath = builder._config.get("builder", "sharepath")
77 self._bin = os.path.join(self._sharepath, "bin")
78 self._preppath = os.path.join(self._bin, "builder-prep")
79 self._intargetpath = os.path.join(self._bin, "in-target")
80@@ -382,7 +382,7 @@
81 object.__init__(self)
82 self._config = config
83 self.builderstatus = BuilderStatus.IDLE
84- self._cachepath = self._config.get("slave","filecache")
85+ self._cachepath = self._config.get("builder", "filecache")
86 self.buildstatus = BuildStatus.OK
87 self.waitingfiles = {}
88 self.builddependencies = ""
89@@ -394,7 +394,7 @@
90
91 def getArch(self):
92 """Return the Architecture tag for the builder."""
93- return self._config.get("slave","architecturetag")
94+ return self._config.get("builder", "architecturetag")
95
96 def cachePath(self, file):
97 """Return the path in the cache of the file specified."""
98
99=== modified file 'lpbuildd/debian.py'
100--- lpbuildd/debian.py 2019-06-10 11:09:51 +0000
101+++ lpbuildd/debian.py 2019-09-27 22:28:16 +0000
102@@ -41,7 +41,7 @@
103
104 def __init__(self, builder, buildid, **kwargs):
105 BuildManager.__init__(self, builder, buildid, **kwargs)
106- self._cachepath = builder._config.get("slave", "filecache")
107+ self._cachepath = builder._config.get("builder", "filecache")
108 self._state = DebianBuildState.INIT
109 builder.emptyLog()
110 self.alreadyfailed = False
111
112=== modified file 'lpbuildd/tests/buildd-slave-test.conf'
113--- lpbuildd/tests/buildd-slave-test.conf 2019-09-27 22:14:50 +0000
114+++ lpbuildd/tests/buildd-slave-test.conf 2019-09-27 22:28:16 +0000
115@@ -1,6 +1,6 @@
116 # Test buildd configuration
117
118-[slave]
119+[builder]
120 architecturetag = i386
121 filecache = /var/tmp/buildd/filecache
122 bindhost = localhost
123
124=== modified file 'lpbuildd/tests/harness.py'
125--- lpbuildd/tests/harness.py 2019-09-27 22:14:50 +0000
126+++ lpbuildd/tests/harness.py 2019-09-27 22:28:16 +0000
127@@ -44,7 +44,7 @@
128 """Setup a Builder using the test config."""
129 conf = SafeConfigParser()
130 conf.read(test_conffile)
131- conf.set("slave", "filecache", tempfile.mkdtemp())
132+ conf.set("builder", "filecache", tempfile.mkdtemp())
133
134 self.slave = Builder(conf)
135 self.slave._log = True
136
137=== modified file 'template-buildd-slave.conf'
138--- template-buildd-slave.conf 2019-09-27 22:14:50 +0000
139+++ template-buildd-slave.conf 2019-09-27 22:28:16 +0000
140@@ -2,7 +2,7 @@
141 #
142 # Configuration for buildd: @NAME@
143
144-[slave]
145+[builder]
146 architecturetag = @ARCHTAG@
147 filecache = /home/buildd/filecache-@NAME@
148 bindhost = @BINDHOST@

Subscribers

People subscribed via source and target branches

to all changes: