launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #04948
lp:~nigelbabu/launchpad/the-return-of-destory-statusexplanation-88545 into lp:launchpad
Nigel Babu has proposed merging lp:~nigelbabu/launchpad/the-return-of-destory-statusexplanation-88545 into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~nigelbabu/launchpad/the-return-of-destory-statusexplanation-88545/+merge/75099
= Description =
Last traces of statusexplanation which I missed.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/canonical/launchpad/scripts/oops.py
lib/canonical/launchpad/scripts/ftests/test_oops_prune.py
./lib/canonical/launchpad/scripts/oops.py
40: Line exceeds 78 characters.
40: local variable 'posix_oops_match' is assigned to but never used
40: E501 line too long (101 characters)
./lib/canonical/launchpad/scripts/ftests/test_oops_prune.py
166: Line exceeds 78 characters.
166: E501 line too long (88 characters)
make: *** [lint] Error 5
--
https://code.launchpad.net/~nigelbabu/launchpad/the-return-of-destory-statusexplanation-88545/+merge/75099
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~nigelbabu/launchpad/the-return-of-destory-statusexplanation-88545 into lp:launchpad.
=== modified file 'lib/canonical/launchpad/scripts/ftests/test_oops_prune.py'
--- lib/canonical/launchpad/scripts/ftests/test_oops_prune.py 2011-08-15 09:21:48 +0000
+++ lib/canonical/launchpad/scripts/ftests/test_oops_prune.py 2011-09-13 00:55:13 +0000
@@ -48,8 +48,8 @@
# whole path rather than the path's basename.
self.oops_dir = tempfile.mkdtemp('.directory.with.dots')
- # TODO: This should be in the errorlog tests, and calling into errorlog
- # methods.
+ # TODO: This should be in the errorlog tests, and calling into
+ # errorlog methods.
# Create some fake OOPS files
self.today = datetime.now(tz=UTC)
self.ages_ago = uniquefileallocator.epoch + timedelta(days=1)
@@ -78,7 +78,6 @@
# Need to commit or the changes are not visible on the slave.
transaction.commit()
-
def tearDown(self):
shutil.rmtree(self.oops_dir)
shutil.rmtree(config.error_reports.error_dir)
@@ -98,10 +97,6 @@
description='OOPS-1BugDescription666'
""")
cur.execute("""
- UPDATE BugTask
- SET statusexplanation='foo OOPS1BugTaskStatusExplanation666'
- """)
- cur.execute("""
UPDATE Question SET
title='OOPS - 1TicketTitle666 bar',
description='http://foo.com OOPS-1TicketDescription666',
@@ -127,7 +122,6 @@
'1MESSAGESUBJECT666',
'1BUGTITLE666',
'1BUGDESCRIPTION666',
- '1BUGTASKSTATUSEXPLANATION666',
'1TICKETTITLE666',
'1TICKETDESCRIPTION666',
'1TICKETWHITEBOARD666',
@@ -176,7 +170,7 @@
referenced_oops())
def test_script(self):
- unwanted = unwanted_oops_files(self.oops_dir, 90)
+ unwanted_oops_files(self.oops_dir, 90)
# Commit so our script can see changes made by the setUp method
LaunchpadZopelessLayer.commit()
process = Popen([
@@ -196,7 +190,7 @@
for dirpath, dirnames, filenames in os.walk(today_dir):
for filename in filenames:
found_oops_files.add(
- path_to_oopsid(os.path.join(dirpath,filename))
+ path_to_oopsid(os.path.join(dirpath, filename))
)
today_day_count = (self.today - uniquefileallocator.epoch).days + 1
self.failUnlessEqual(
@@ -232,9 +226,8 @@
'Script failed to remove 2006-01-03 directory'
)
-
def test_script_dryrun(self):
- unwanted = unwanted_oops_files(self.oops_dir, 90)
+ unwanted_oops_files(self.oops_dir, 90)
# Commit so our script can see changes made by the setUp method
LaunchpadZopelessLayer.commit()
@@ -270,7 +263,7 @@
def test_script_default_error_dir(self):
# Verify that the script runs without the error_dir argument.
default_error_dir = config.error_reports.error_dir
- unwanted = unwanted_oops_files(default_error_dir, 90)
+ unwanted_oops_files(default_error_dir, 90)
# Commit so our script can see changes made by the setUp method.
LaunchpadZopelessLayer.commit()
process = Popen([
@@ -288,7 +281,7 @@
# And a directory empty of OOPS reports, but with some rubbish
os.mkdir(os.path.join(self.oops_dir, '2001-12-02'))
open(
- os.path.join( self.oops_dir, '2001-12-02', 'foo'), 'w'
+ os.path.join(self.oops_dir, '2001-12-02', 'foo'), 'w'
).write('foo')
prune_empty_oops_directories(self.oops_dir)
=== modified file 'lib/canonical/launchpad/scripts/oops.py'
--- lib/canonical/launchpad/scripts/oops.py 2011-08-15 09:21:48 +0000
+++ lib/canonical/launchpad/scripts/oops.py 2011-09-13 00:55:13 +0000
@@ -48,9 +48,6 @@
FROM Bug WHERE title %(posix_oops_match)s
OR description %(posix_oops_match)s
UNION ALL
- SELECT statusexplanation FROM BugTask
- WHERE statusexplanation %(posix_oops_match)s
- UNION ALL
SELECT title || ' ' || description || ' ' || COALESCE(whiteboard,'')
FROM Question WHERE title %(posix_oops_match)s
OR description %(posix_oops_match)s
@@ -63,7 +60,6 @@
cur = cursor()
cur.execute(query)
for content in (row[0] for row in cur.fetchall()):
- found = False
for match in FormattersAPI._re_linkify.finditer(content):
if match.group('oops') is not None:
code_string = match.group('oopscode')
@@ -133,6 +129,7 @@
) is not None:
yield os.path.join(dirpath, filename)
+
def prune_empty_oops_directories(root_path):
for filename in os.listdir(root_path):
if re.search(r'^\d\d\d\d-\d\d-\d\d$', filename) is None:
@@ -143,4 +140,3 @@
if os.listdir(path):
continue
os.rmdir(path)
-
Follow ups