Merge lp:~matttbe/ubuntu/quantal/apache2/lp1013171 into lp:ubuntu/quantal/apache2

Proposed by Matthieu Baerts
Status: Merged
Merged at revision: 78
Proposed branch: lp:~matttbe/ubuntu/quantal/apache2/lp1013171
Merge into: lp:ubuntu/quantal/apache2
Diff against target: 79 lines (+37/-26)
2 files modified
debian/apache2.py (+29/-26)
debian/changelog (+8/-0)
To merge this branch: bzr merge lp:~matttbe/ubuntu/quantal/apache2/lp1013171
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+113083@code.launchpad.net

Description of the change

Hello,

This is just a patch to update apport hook for python3.
Now, Apport adds informations only if '/etc/apache2/sites-enabled/' exists to avoid errors.

Regards,

Matt

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for this! However, the lower half of the apport hook is relevant even without a sites-enabled directory, so I'll take those out of the "then" branch.

review: Approve
Revision history for this message
Matthieu Baerts (matttbe) wrote :

Yes, you're right!
I just hope that 'error.log' file doesn't contain any sensitive information ;)
Thank you for this review!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/apache2.py'
2--- debian/apache2.py 2010-11-22 09:43:43 +0000
3+++ debian/apache2.py 2012-07-02 17:51:21 +0000
4@@ -15,30 +15,33 @@
5 from apport.hookutils import *
6 import os
7
8+SITES_ENABLED_DIR = '/etc/apache2/sites-enabled/'
9+
10 def add_info(report, ui):
11- response = ui.yesno("The contents of your /etc/apache2/sites-enabled directory "
12- "may help developers diagnose your bug more "
13- "quickly. However, it may contain sensitive "
14- "information. Do you want to include it in your "
15- "bug report?")
16-
17- if response == None: # user cancelled
18- raise StopIteration
19-
20- elif response == True:
21- # Attache config files in /etc/apache2/sites-enabled and listing of files in /etc/apache2/conf.d
22- for conf_file in os.listdir('/etc/apache2/sites-enabled'):
23- attach_file_if_exists(report, '/etc/apache2/sites-enabled/' + conf_file, conf_file)
24- try:
25- report['Apache2ConfdDirListing'] = unicode(os.listdir('/etc/apache2/conf.d'))
26- except OSError:
27- report['Apache2ConfdDirListing'] = unicode(False)
28-
29- # Attach default config files if changed.
30- attach_conffiles(report, 'apache2.2-common', conffiles=None)
31-
32- # Attach the error.log file.
33- attach_file(report, '/var/log/apache2/error.log', key='error.log')
34-
35- # Get loaded modules.
36- report['Apache2Modules'] = root_command_output(['/usr/sbin/apachectl', '-D DUMP_MODULES'])
37+ if os.path.isdir(SITES_ENABLED_DIR):
38+ response = ui.yesno("The contents of your " + SITES_ENABLED_DIR + " directory "
39+ "may help developers diagnose your bug more "
40+ "quickly. However, it may contain sensitive "
41+ "information. Do you want to include it in your "
42+ "bug report?")
43+
44+ if response == None: # user cancelled
45+ raise StopIteration
46+
47+ elif response == True:
48+ # Attache config files in /etc/apache2/sites-enabled and listing of files in /etc/apache2/conf.d
49+ for conf_file in os.listdir(SITES_ENABLED_DIR):
50+ attach_file_if_exists(report, SITES_ENABLED_DIR + conf_file, conf_file)
51+ try:
52+ report['Apache2ConfdDirListing'] = str(os.listdir('/etc/apache2/conf.d'))
53+ except OSError:
54+ report['Apache2ConfdDirListing'] = str(False)
55+
56+ # Attach default config files if changed.
57+ attach_conffiles(report, 'apache2.2-common', conffiles=None)
58+
59+ # Attach the error.log file.
60+ attach_file(report, '/var/log/apache2/error.log', key='error.log')
61+
62+ # Get loaded modules.
63+ report['Apache2Modules'] = root_command_output(['/usr/sbin/apachectl', '-D DUMP_MODULES'])
64
65=== modified file 'debian/changelog'
66--- debian/changelog 2012-06-08 11:37:31 +0000
67+++ debian/changelog 2012-07-02 17:51:21 +0000
68@@ -1,3 +1,11 @@
69+apache2 (2.2.22-6ubuntu2) UNRELEASED; urgency=low
70+
71+ * debian/apache2.py
72+ - Update apport hook for python3 ; thanks to Edward Donovan (LP: #1013171)
73+ - Check if this directory exists: /etc/apache2/sites-enabled/
74+
75+ -- Matthieu Baerts (matttbe) <matttbe@gmail.com> Mon, 02 Jul 2012 19:43:59 +0200
76+
77 apache2 (2.2.22-6ubuntu1) quantal; urgency=low
78
79 * Merge from Debian unstable. Remaining changes:

Subscribers

People subscribed via source and target branches