-
[calculate_bug_heat]
# The database user which will be used by this process.
# datatype: string
@@ -37,6 +36,13 @@
error_dir: none
copy_to_zlog: false
+[process_apport_blobs]
+# The database user which will be used by this process.
+# datatype: string
+dbuser: process-apport-blobs
+oops_prefix: APPORTBLOB
+error_dir: none
+copy_to_zlog: false
[branchscanner]
# The database user which will be used by this process.
Non-crazy diff:
=== modified file 'configs/ development/ launchpad- lazr.conf' development/ launchpad- lazr.conf 2010-01-22 04:01:17 +0000 development/ launchpad- lazr.conf 2010-02-12 15:44:24 +0000
--- configs/
+++ configs/
@@ -221,6 +221,9 @@
error_dir: /var/tmp/poimport
oops_prefix: POI
+[process_ apport_ blobs] puller] codehosting. test
+error_dir: /var/tmp/lperr
+
[supermirror_
error_dir: /var/tmp/
oops_prefix: SMP
=== modified file 'configs/ testrunner/ launchpad- lazr.conf' testrunner/ launchpad- lazr.conf 2010-01-29 17:15:31 +0000 testrunner/ launchpad- lazr.conf 2010-02-12 15:44:24 +0000 poimport. test
--- configs/
+++ configs/
@@ -193,6 +193,11 @@
error_dir: /var/tmp/
oops_prefix: TPOI
+[process_ apport_ blobs] apport- blobs rosettabranches .test
+dbuser: process-
+oops_prefix: TAPPORTBLOB
+error_dir: /var/tmp/lperr.test
+
[rosettabranches]
oops_prefix: TRSBR
error_dir: /var/tmp/
=== added file 'cronscripts/ process- apport- blobs.py' process- apport- blobs.py 1970-01-01 00:00:00 +0000 process- apport- blobs.py 2010-02-11 18:50:58 +0000 bin/python2. 5 launchpad. webapp import errorlog job.runner import JobCronScript interfaces. apportjob import IProcessApportB lobJobSource tBlobs( JobCronScript) : obJobs. """ apport_ blobs' lobJobSource globalErrorUtil ity.configure( self.config_ name) sApportBlobs, self).main() tBlobs( ) lock_and_ run()
--- cronscripts/
+++ cronscripts/
@@ -0,0 +1,33 @@
+#!/usr/
+#
+# Copyright 2010 Canonical Ltd. This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+# pylint: disable-msg=W0403
+
+"""Process uploaded Apport BLOBs."""
+
+__metaclass__ = type
+
+import _pythonpath
+
+from canonical.
+
+from lp.services.
+from lp.bugs.
+
+
+class RunProcessAppor
+ """Run ProcessApportBl
+
+ config_name = 'process_
+ source_interface = IProcessApportB
+
+ def main(self):
+ errorlog.
+ return super(RunProces
+
+
+if __name__ == '__main__':
+ script = RunProcessAppor
+ script.
=== modified file 'database/ schema/ security. cfg' schema/ security. cfg 2010-02-02 11:58:46 +0000 schema/ security. cfg 2010-02-12 15:44:24 +0000 apport- blobs] libraryfilealia s = SELECT, INSERT, UPDATE libraryfilecont ent = SELECT, INSERT, UPDATE
--- database/
+++ database/
@@ -1897,3 +1897,11 @@
public.bug = SELECT, UPDATE
public.job = SELECT, UPDATE, DELETE
public.bugjob = SELECT, DELETE
+
+[process-
+type=user
+groups=script,read
+public.job = SELECT, UPDATE, DELETE
+public.apportjob = SELECT, INSERT, UPDATE, DELETE
+public.
+public.
=== modified file 'lib/canonical/ config/ schema- lazr.conf' config/ schema- lazr.conf 2010-01-22 04:01:17 +0000 config/ schema- lazr.conf 2010-02-12 15:44:24 +0000 ftpmaster. internal/
--- lib/canonical/
+++ lib/canonical/
@@ -28,7 +28,6 @@
# datatype: string
base_url: http://
- bug_heat]
[calculate_
# The database user which will be used by this process.
# datatype: string
@@ -37,6 +36,13 @@
error_dir: none
copy_to_zlog: false
+[process_ apport_ blobs] apport- blobs
+# The database user which will be used by this process.
+# datatype: string
+dbuser: process-
+oops_prefix: APPORTBLOB
+error_dir: none
+copy_to_zlog: false
[branchscanner]
# The database user which will be used by this process.
=== modified file 'lib/canonical/ launchpad/ browser/ temporaryblobst orage.py' launchpad/ browser/ temporaryblobst orage.py 2010-02-10 14:17:10 +0000 launchpad/ browser/ temporaryblobst orage.py 2010-02-12 12:16:54 +0000 'Continue' , name='FORM_SUBMIT') action( self, action, data): blob(data[ 'blob'] ) response. setHeader( 'X-Launchpad- Blob-Token' , uuid) response. addInfoNotifica tion( response. setHeader( 'X-Launchpad- Blob-Token' , uuid) response. addInfoNotifica tion(
--- lib/canonical/
+++ lib/canonical/
@@ -43,9 +43,10 @@
@action(
def continue_
uuid = self.store_
- self.request.
- self.request.
- 'Your ticket is "%s"' % uuid)
+ if uuid is not None:
+ self.request.
+ self.request.
+ 'Your ticket is "%s"' % uuid)
def store_blob(self, blob): ITemporaryStora geManager) .new(blob)
self. addError( 'Uploaded file was too large.')
self. addError( 'File storage unavailable - try again later.') obJob for the BLOB. ITemporaryStora geManager) .fetch( uuid) IProcessApportB lobJobSource) .create( blob) obJob for the BLOB. ITemporaryStora geManager) .fetch( uuid) IProcessApportB lobJobSource) .create( blob)
"""Store a blob and return its UUID."""
@@ -53,10 +54,13 @@
uuid = getUtility(
except BlobTooLarge:
- except UploadFailed:
+ return None
+ except UploadFailed, e:
+ import pdb; pdb.set_trace()
-
- # Create ProcessApportBl
- blob = getUtility(
- getUtility(
- return uuid
+ return None
+ else:
+ # Create ProcessApportBl
+ blob = getUtility(
+ getUtility(
+ return uuid
=== modified file 'lib/lp/ bugs/tests/ test_apportjob. py' bugs/tests/ test_apportjob. py 2010-02-11 10:59:08 +0000 bugs/tests/ test_apportjob. py 2010-02-12 15:44:24 +0000 launchpad. interfaces. temporaryblobst orage import ( StorageManager) launchpad. webapp. interfaces import ILaunchpadRoot launchpad. scripts. tests import run_script unctionalLayer, LaunchpadZopele ssLayer)
--- lib/lp/
+++ lib/lp/
@@ -16,6 +16,7 @@
from canonical.
ITemporary
from canonical.
+from canonical.
from canonical.testing import (
LaunchpadF
@@ -224,6 +225,19 @@
self. assertEqual( job.id, yet_another_job.id, "Jobs do not match.")
# it's attached to the same BLOB.
+ def test_cronscript _succeeds( self): apport- blobs cronscript will run all pending obJobs. obJob.create( self.blob) commit( ) process- apport- blobs.py' , [], returncode= 0) l('', stdout) lobJobSource jobs.\n', stderr)
+ # The process-
+ # ProcessApportBl
+ ProcessApportBl
+ transaction.
+
+ retcode, stdout, stderr = run_script(
+ 'cronscripts/
+ expect_
+ self.assertEqua
+ self.assertIn(
+ 'INFO Ran 1 IProcessApportB
+
class TestTemporaryBl obStorageAddVie w(TestCaseWithF actory) : orageAddView. """
"""Test case for the TemporaryBlobSt