Merge lp:~jml/launchpad/twisted-services into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Jonathan Lange
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/twisted-services
Merge into: lp:launchpad
Diff against target: 353 lines (+46/-45)
17 files modified
cronscripts/supermirror-pull.py (+2/-2)
lib/lp/buildmaster/manager.py (+2/-1)
lib/lp/codehosting/codeimport/tests/test_workermonitor.py (+5/-5)
lib/lp/codehosting/codeimport/workermonitor.py (+4/-4)
lib/lp/codehosting/puller/scheduler.py (+3/-3)
lib/lp/codehosting/puller/tests/test_scheduler.py (+8/-8)
lib/lp/codehosting/sftp.py (+2/-2)
lib/lp/codehosting/sshserver/accesslog.py (+1/-1)
lib/lp/codehosting/sshserver/service.py (+2/-3)
lib/lp/codehosting/sshserver/tests/test_auth.py (+2/-2)
lib/lp/codehosting/vfs/transport.py (+2/-1)
lib/lp/services/job/runner.py (+3/-3)
lib/lp/services/twistedsupport/tests/test_loggingsupport.py (+3/-3)
lib/lp/services/twistedsupport/tests/test_processmonitor.py (+3/-3)
lib/lp/services/twistedsupport/tests/test_task.py (+1/-1)
lib/lp/services/twistedsupport/tests/test_twistedsupport.py (+2/-2)
scripts/code-import-worker-monitor.py (+1/-1)
To merge this branch: bzr merge lp:~jml/launchpad/twisted-services
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+21716@code.launchpad.net

Commit message

Move canonical.twistedsupport to lp.services.twistedsupport

Description of the change

This patch moves canonical.twistedsupport to lp.services.twistedsupport.

It cleans up some flakes along the way and orders imports correctly.

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cronscripts/supermirror-pull.py'
2--- cronscripts/supermirror-pull.py 2010-02-24 04:24:01 +0000
3+++ cronscripts/supermirror-pull.py 2010-03-19 10:48:30 +0000
4@@ -11,10 +11,10 @@
5 from twisted.internet import defer, reactor
6 from twisted.python import log as tplog
7
8-from lp.codehosting.puller import mirror, scheduler
9 from canonical.config import config
10 from canonical.launchpad.scripts import logger_options
11-from canonical.twistedsupport.loggingsupport import (
12+from lp.codehosting.puller import mirror, scheduler
13+from lp.services.twistedsupport.loggingsupport import (
14 LoggingProxy, set_up_logging_for_script)
15
16 def clean_shutdown(ignored):
17
18=== modified file 'lib/lp/buildmaster/manager.py'
19--- lib/lp/buildmaster/manager.py 2010-03-04 16:12:33 +0000
20+++ lib/lp/buildmaster/manager.py 2010-03-19 10:48:30 +0000
21@@ -30,8 +30,9 @@
22 from canonical.config import config
23 from canonical.launchpad.webapp import urlappend
24 from canonical.librarian.db import write_transaction
25-from canonical.twistedsupport.processmonitor import run_process_with_timeout
26 from lp.buildmaster.interfaces.buildbase import BUILDD_MANAGER_LOG_NAME
27+from lp.services.twistedsupport.processmonitor import run_process_with_timeout
28+
29
30 buildd_success_result_map = {
31 'ensurepresent': True,
32
33=== modified file 'lib/lp/codehosting/codeimport/tests/test_workermonitor.py'
34--- lib/lp/codehosting/codeimport/tests/test_workermonitor.py 2010-03-14 10:38:48 +0000
35+++ lib/lp/codehosting/codeimport/tests/test_workermonitor.py 2010-03-19 10:48:30 +0000
36@@ -18,8 +18,8 @@
37 from bzrlib.branch import Branch
38 from bzrlib.tests import TestCase as BzrTestCase
39
40-from twisted.internet import defer, error, protocol, reactor, task
41-from twisted.python import failure, log
42+from twisted.internet import defer, error, protocol, reactor
43+from twisted.python import log
44 from twisted.trial.unittest import TestCase as TrialTestCase
45 from twisted.web import xmlrpc
46
47@@ -32,9 +32,6 @@
48 from canonical.launchpad.xmlrpc.faults import NoSuchCodeImportJob
49 from canonical.testing.layers import (
50 TwistedAppServerLayer, TwistedLaunchpadZopelessLayer, TwistedLayer)
51-from canonical.twistedsupport import suppress_stderr
52-from canonical.twistedsupport.tests.test_processmonitor import (
53- makeFailure, ProcessTestsMixin)
54
55 from lp.code.enums import (
56 CodeImportResultStatus, CodeImportReviewStatus, RevisionControlSystems)
57@@ -52,6 +49,9 @@
58 CVSServer, GitServer, MercurialServer, SubversionServer)
59 from lp.codehosting.codeimport.tests.test_worker import (
60 clean_up_default_stores_for_import)
61+from lp.services.twistedsupport import suppress_stderr
62+from lp.services.twistedsupport.tests.test_processmonitor import (
63+ makeFailure, ProcessTestsMixin)
64 from lp.testing import login, logout, TestCase
65 from lp.testing.factory import LaunchpadObjectFactory
66
67
68=== modified file 'lib/lp/codehosting/codeimport/workermonitor.py'
69--- lib/lp/codehosting/codeimport/workermonitor.py 2010-03-11 23:21:41 +0000
70+++ lib/lp/codehosting/codeimport/workermonitor.py 2010-03-19 10:48:30 +0000
71@@ -21,12 +21,12 @@
72 from canonical.config import config
73 from canonical.launchpad.xmlrpc.faults import NoSuchCodeImportJob
74 from canonical.librarian.interfaces import IFileUploadClient
75-from canonical.twistedsupport.loggingsupport import (
76+from lp.code.enums import CodeImportResultStatus
77+from lp.codehosting.codeimport.worker import CodeImportWorkerExitCode
78+from lp.services.twistedsupport.loggingsupport import (
79 log_oops_from_failure)
80-from canonical.twistedsupport.processmonitor import (
81+from lp.services.twistedsupport.processmonitor import (
82 ProcessMonitorProtocolWithTimeout)
83-from lp.code.enums import CodeImportResultStatus
84-from lp.codehosting.codeimport.worker import CodeImportWorkerExitCode
85
86
87 class CodeImportWorkerMonitorProtocol(ProcessMonitorProtocolWithTimeout):
88
89=== modified file 'lib/lp/codehosting/puller/scheduler.py'
90--- lib/lp/codehosting/puller/scheduler.py 2010-02-24 04:24:01 +0000
91+++ lib/lp/codehosting/puller/scheduler.py 2010-03-19 10:48:30 +0000
92@@ -24,16 +24,16 @@
93
94 import canonical
95 from canonical.cachedproperty import cachedproperty
96-from canonical.twistedsupport.task import (
97- ParallelLimitedTaskConsumer, PollingTaskSource)
98 from lp.codehosting.puller.worker import (
99 get_canonical_url_for_branch_name)
100 from lp.codehosting.puller import get_lock_id_for_branch_id
101 from canonical.config import config
102 from canonical.launchpad.webapp import errorlog
103 from canonical.launchpad.xmlrpc import faults
104-from canonical.twistedsupport.processmonitor import (
105+from lp.services.twistedsupport.processmonitor import (
106 ProcessMonitorProtocolWithTimeout)
107+from lp.services.twistedsupport.task import (
108+ ParallelLimitedTaskConsumer, PollingTaskSource)
109
110
111 class BadMessage(Exception):
112
113=== modified file 'lib/lp/codehosting/puller/tests/test_scheduler.py'
114--- lib/lp/codehosting/puller/tests/test_scheduler.py 2010-03-04 20:14:46 +0000
115+++ lib/lp/codehosting/puller/tests/test_scheduler.py 2010-03-19 10:48:30 +0000
116@@ -16,27 +16,27 @@
117 from bzrlib.branch import Branch
118 from bzrlib.bzrdir import BzrDir
119
120-from twisted.internet import defer, error, reactor, task
121+from twisted.internet import defer, error, reactor
122 from twisted.protocols.basic import NetstringParseError
123 from twisted.python import failure
124 from twisted.trial.unittest import TestCase as TrialTestCase
125
126 from zope.component import getUtility
127
128+from canonical.config import config
129+from canonical.launchpad.webapp import errorlog
130+from canonical.launchpad.xmlrpc import faults
131+from canonical.testing import (
132+ reset_logging, TwistedLayer, TwistedAppServerLayer)
133 from lp.codehosting.puller import get_lock_id_for_branch_id, scheduler
134 from lp.codehosting.puller.tests import PullerBranchTestCase
135 from lp.codehosting.puller.worker import (
136 get_canonical_url_for_branch_name)
137-from canonical.config import config
138 from lp.code.enums import BranchType
139 from lp.code.interfaces.branchlookup import IBranchLookup
140+from lp.services.twistedsupport.tests.test_processmonitor import (
141+ makeFailure, suppress_stderr, ProcessTestsMixin)
142 from lp.testing.factory import ObjectFactory
143-from canonical.launchpad.webapp import errorlog
144-from canonical.launchpad.xmlrpc import faults
145-from canonical.testing import (
146- reset_logging, TwistedLayer, TwistedAppServerLayer)
147-from canonical.twistedsupport.tests.test_processmonitor import (
148- makeFailure, suppress_stderr, ProcessTestsMixin)
149
150
151 class FakePullerEndpointProxy:
152
153=== modified file 'lib/lp/codehosting/sftp.py'
154--- lib/lp/codehosting/sftp.py 2010-01-20 20:51:48 +0000
155+++ lib/lp/codehosting/sftp.py 2010-03-19 10:48:30 +0000
156@@ -14,7 +14,7 @@
157
158 __metaclass__ = type
159 __all__ = [
160- 'AvatarToSFTPAdapter',
161+ 'avatar_to_sftp_server',
162 'FileTransferServer',
163 'TransportSFTPServer',
164 ]
165@@ -40,7 +40,7 @@
166 from lp.codehosting.vfs import AsyncLaunchpadTransport, LaunchpadServer
167 from lp.codehosting.sshserver import accesslog
168 from canonical.config import config
169-from canonical.twistedsupport import gatherResults
170+from lp.services.twistedsupport import gatherResults
171
172
173 class FileIsADirectory(bzr_errors.PathError):
174
175=== modified file 'lib/lp/codehosting/sshserver/accesslog.py'
176--- lib/lp/codehosting/sshserver/accesslog.py 2009-06-25 04:06:00 +0000
177+++ lib/lp/codehosting/sshserver/accesslog.py 2010-03-19 10:48:30 +0000
178@@ -29,7 +29,7 @@
179
180 from canonical.config import config
181 from canonical.launchpad.scripts import WatchedFileHandler
182-from canonical.twistedsupport.loggingsupport import set_up_oops_reporting
183+from lp.services.twistedsupport.loggingsupport import set_up_oops_reporting
184
185
186 def synchronize(source, target, add, remove):
187
188=== modified file 'lib/lp/codehosting/sshserver/service.py'
189--- lib/lp/codehosting/sshserver/service.py 2010-03-03 23:45:34 +0000
190+++ lib/lp/codehosting/sshserver/service.py 2010-03-19 10:48:30 +0000
191@@ -20,15 +20,14 @@
192 from twisted.conch.ssh.transport import SSHServerTransport
193 from twisted.internet import defer
194 from twisted.protocols.policies import TimeoutFactory
195-from twisted.python import log
196 from twisted.web.xmlrpc import Proxy
197
198 from zope.event import notify
199
200+from canonical.config import config
201 from lp.codehosting.sshserver import accesslog
202 from lp.codehosting.sshserver.auth import get_portal, SSHUserAuthServer
203-from canonical.config import config
204-from canonical.twistedsupport import gatherResults
205+from lp.services.twistedsupport import gatherResults
206
207
208 class KeepAliveSettingSSHServerTransport(SSHServerTransport):
209
210=== modified file 'lib/lp/codehosting/sshserver/tests/test_auth.py'
211--- lib/lp/codehosting/sshserver/tests/test_auth.py 2009-07-17 00:26:05 +0000
212+++ lib/lp/codehosting/sshserver/tests/test_auth.py 2010-03-19 10:48:30 +0000
213@@ -22,11 +22,11 @@
214
215 from twisted.trial.unittest import TestCase as TrialTestCase
216
217-from lp.codehosting.sshserver import auth, service
218 from canonical.config import config
219 from canonical.launchpad.xmlrpc import faults
220 from canonical.testing.layers import TwistedLayer
221-from canonical.twistedsupport import suppress_stderr
222+from lp.codehosting.sshserver import auth, service
223+from lp.services.twistedsupport import suppress_stderr
224
225
226 class MockRealm:
227
228=== modified file 'lib/lp/codehosting/vfs/transport.py'
229--- lib/lp/codehosting/vfs/transport.py 2010-02-16 23:59:40 +0000
230+++ lib/lp/codehosting/vfs/transport.py 2010-03-19 10:48:30 +0000
231@@ -30,7 +30,8 @@
232 unregister_transport)
233
234 from twisted.internet import defer
235-from canonical.twistedsupport import extract_result, gatherResults
236+
237+from lp.services.twistedsupport import extract_result, gatherResults
238
239
240 class TranslationError(BzrError):
241
242=== modified file 'lib/lp/services/job/runner.py'
243--- lib/lp/services/job/runner.py 2010-03-15 13:57:06 +0000
244+++ lib/lp/services/job/runner.py 2010-03-19 10:48:30 +0000
245@@ -34,11 +34,11 @@
246 from canonical.lp import initZopeless
247 from canonical.launchpad import scripts
248 from canonical.launchpad.webapp import errorlog
249-from canonical.twistedsupport.task import (
250- ParallelLimitedTaskConsumer, PollingTaskSource)
251-from lp.services.scripts.base import LaunchpadCronScript
252 from lp.services.job.interfaces.job import LeaseHeld, IRunnableJob, IJob
253 from lp.services.mail.sendmail import MailController
254+from lp.services.scripts.base import LaunchpadCronScript
255+from lp.services.twistedsupport.task import (
256+ ParallelLimitedTaskConsumer, PollingTaskSource)
257
258
259 class BaseRunnableJob:
260
261=== renamed directory 'lib/canonical/twistedsupport' => 'lib/lp/services/twistedsupport'
262=== modified file 'lib/lp/services/twistedsupport/tests/test_loggingsupport.py'
263--- lib/canonical/twistedsupport/tests/test_loggingsupport.py 2009-06-25 05:30:52 +0000
264+++ lib/lp/services/twistedsupport/tests/test_loggingsupport.py 2010-03-19 10:48:30 +0000
265@@ -21,12 +21,12 @@
266
267 from canonical.config import config
268 from canonical.launchpad.webapp.errorlog import globalErrorUtility
269-from lp.testing import TestCase as LaunchpadTestCase
270 from canonical.testing.layers import TwistedLayer
271-from canonical.twistedsupport.loggingsupport import (
272+from lp.services.twistedsupport.loggingsupport import (
273 LaunchpadLogFile, OOPSLoggingObserver)
274-from canonical.twistedsupport.tests.test_processmonitor import (
275+from lp.services.twistedsupport.tests.test_processmonitor import (
276 makeFailure, suppress_stderr)
277+from lp.testing import TestCase as LaunchpadTestCase
278
279
280 UTC = pytz.utc
281
282=== modified file 'lib/lp/services/twistedsupport/tests/test_processmonitor.py'
283--- lib/canonical/twistedsupport/tests/test_processmonitor.py 2010-02-24 03:20:11 +0000
284+++ lib/lp/services/twistedsupport/tests/test_processmonitor.py 2010-03-19 10:48:30 +0000
285@@ -10,13 +10,13 @@
286
287 import unittest
288
289-from twisted.internet import defer, error, reactor, task
290+from twisted.internet import defer, error, task
291 from twisted.python import failure
292 from twisted.trial.unittest import TestCase as TrialTestCase
293
294 from canonical.testing import TwistedLayer
295-from canonical.twistedsupport import suppress_stderr
296-from canonical.twistedsupport.processmonitor import (
297+from lp.services.twistedsupport import suppress_stderr
298+from lp.services.twistedsupport.processmonitor import (
299 ProcessMonitorProtocol, ProcessMonitorProtocolWithTimeout,
300 ProcessProtocolWithTwoStageKill, run_process_with_timeout)
301
302
303=== modified file 'lib/lp/services/twistedsupport/tests/test_task.py'
304--- lib/canonical/twistedsupport/tests/test_task.py 2010-01-17 06:23:01 +0000
305+++ lib/lp/services/twistedsupport/tests/test_task.py 2010-03-19 10:48:30 +0000
306@@ -13,7 +13,7 @@
307
308 from zope.interface import implements
309
310-from canonical.twistedsupport.task import (
311+from lp.services.twistedsupport.task import (
312 AlreadyRunningError, ITaskConsumer, ITaskSource, NotRunningError,
313 ParallelLimitedTaskConsumer, PollingTaskSource)
314 from lp.testing import TestCase
315
316=== modified file 'lib/lp/services/twistedsupport/tests/test_twistedsupport.py'
317--- lib/canonical/twistedsupport/tests/test_twistedsupport.py 2009-06-25 05:30:52 +0000
318+++ lib/lp/services/twistedsupport/tests/test_twistedsupport.py 2010-03-19 10:48:30 +0000
319@@ -1,7 +1,7 @@
320 # Copyright 2009 Canonical Ltd. This software is licensed under the
321 # GNU Affero General Public License version 3 (see the file LICENSE).
322
323-"""Tests for things found directly in `canonical.twistedsupport`."""
324+"""Tests for things found directly in `lp.services.twistedsupport`."""
325
326 __metaclass__ = type
327
328@@ -9,7 +9,7 @@
329
330 from twisted.internet import defer
331
332-from canonical.twistedsupport import extract_result
333+from lp.services.twistedsupport import extract_result
334 from lp.testing import TestCase
335
336 class TestExtractResult(TestCase):
337
338=== modified file 'scripts/code-import-worker-monitor.py'
339--- scripts/code-import-worker-monitor.py 2010-03-11 23:21:41 +0000
340+++ scripts/code-import-worker-monitor.py 2010-03-19 10:48:30 +0000
341@@ -25,11 +25,11 @@
342 from twisted.web import xmlrpc
343
344 from canonical.config import config
345-from canonical.twistedsupport.loggingsupport import set_up_oops_reporting
346
347 from lp.codehosting.codeimport.workermonitor import (
348 CodeImportWorkerMonitor)
349 from lp.services.scripts.base import LaunchpadScript
350+from lp.services.twistedsupport.loggingsupport import set_up_oops_reporting
351
352
353 class CodeImportWorker(LaunchpadScript):