15
15
from apport.hookutils import *
18
SITES_ENABLED_DIR = '/etc/apache2/sites-enabled/'
18
20
def add_info(report, ui):
19
response = ui.yesno("The contents of your /etc/apache2/sites-enabled directory "
20
"may help developers diagnose your bug more "
21
"quickly. However, it may contain sensitive "
22
"information. Do you want to include it in your "
25
if response == None: # user cancelled
28
elif response == True:
29
# Attache config files in /etc/apache2/sites-enabled and listing of files in /etc/apache2/conf.d
30
for conf_file in os.listdir('/etc/apache2/sites-enabled'):
31
attach_file_if_exists(report, '/etc/apache2/sites-enabled/' + conf_file, conf_file)
33
report['Apache2ConfdDirListing'] = unicode(os.listdir('/etc/apache2/conf.d'))
35
report['Apache2ConfdDirListing'] = unicode(False)
37
# Attach default config files if changed.
38
attach_conffiles(report, 'apache2.2-common', conffiles=None)
40
# Attach the error.log file.
41
attach_file(report, '/var/log/apache2/error.log', key='error.log')
44
report['Apache2Modules'] = root_command_output(['/usr/sbin/apachectl', '-D DUMP_MODULES'])
21
if os.path.isdir(SITES_ENABLED_DIR):
22
response = ui.yesno("The contents of your " + SITES_ENABLED_DIR + " directory "
23
"may help developers diagnose your bug more "
24
"quickly. However, it may contain sensitive "
25
"information. Do you want to include it in your "
28
if response == None: # user cancelled
31
elif response == True:
32
# Attache config files in /etc/apache2/sites-enabled and listing of files in /etc/apache2/conf.d
33
for conf_file in os.listdir(SITES_ENABLED_DIR):
34
attach_file_if_exists(report, SITES_ENABLED_DIR + conf_file, conf_file)
37
report['Apache2ConfdDirListing'] = str(os.listdir('/etc/apache2/conf.d'))
39
report['Apache2ConfdDirListing'] = str(False)
41
# Attach default config files if changed.
42
attach_conffiles(report, 'apache2.2-common', conffiles=None)
44
# Attach the error.log file.
45
attach_file(report, '/var/log/apache2/error.log', key='error.log')
48
report['Apache2Modules'] = root_command_output(['/usr/sbin/apachectl', '-D DUMP_MODULES'])