~ubuntu-branches/ubuntu/lucid/eucalyptus/lucid

53 by Matt Zimmerman, Colin Watson, Matt Zimmerman
[ Colin Watson ]
1
import os.path, os
2
3
from apport.hookutils import *
4
100 by Dustin Kirkland, Chuck Short
[Chuck Short]
5
def installed_packages(report):
6
    packages=['vmbuilder', 'euca2ools', 'ec2-api-tools', 'ec2-ami-tools', 'eucalyptus-common', 'eucalyptus-sc', 
7
	'eucalyptus-cloud', 'eucalyptus-walrus', 'eucalyptus-java-common', 'eucalyptus-cc',
8
	'eucalyptus-nc', 'eucalyptus-gl', 'uec-component-listener']
9
10
    version = ''
140 by Dustin Kirkland, Dustin Kirkland, Scott Moser
[ Dustin Kirkland ]
11
    versions = ''
100 by Dustin Kirkland, Chuck Short
[Chuck Short]
12
    for package in packages:
13
	try:
140 by Dustin Kirkland, Dustin Kirkland, Scott Moser
[ Dustin Kirkland ]
14
		version = packaging.get_versions(package)
15
	except (ValueError, AttributeError):
100 by Dustin Kirkland, Chuck Short
[Chuck Short]
16
		version = 'N/A'
17
	if version is None:
18
		version = 'N/A'
19
	versions += '%s %s\n' %(package, version)
20
    report['EucalyptusInstalledVersions'] = versions
21
140 by Dustin Kirkland, Dustin Kirkland, Scott Moser
[ Dustin Kirkland ]
22
def add_info(report, ui):
100 by Dustin Kirkland, Chuck Short
[Chuck Short]
23
    # Report on the versions that are installed, including: vmbuilder, ec2-api-tools
24
    # ec2-ami-tools, euca2ools, and eucalyptus*
25
    installed_packages(report)
26
97 by Dustin Kirkland, Mathias Gug, Dustin Kirkland
[ Mathias Gug ]
27
    attach_file_if_exists(report, '/etc/eucalyptus/eucalyptus.conf', key='eucalyptus.conf')
28
    attach_file_if_exists(report, '/etc/eucalyptus/eucalyptus.local.conf', key='eucalyptus.local.conf')
53 by Matt Zimmerman, Colin Watson, Matt Zimmerman
[ Colin Watson ]
29
    attach_file_if_exists(report, '/etc/eucalyptus/eucalyptus-cc.conf')
30
141 by Scott Moser
* debian/source_eucalyptus.py (LP: #541486):
31
    logd = "/var/log/eucalyptus/"
32
    response = ui.yesno("Would you like to attach Eucalyptus log files in %s to this bug report?  These log files can be helpful to developers, but may contain sensitive data." % (logd))
100 by Dustin Kirkland, Chuck Short
[Chuck Short]
33
    if response == None: #use canceled
141 by Scott Moser
* debian/source_eucalyptus.py (LP: #541486):
34
        raise StopIteration
100 by Dustin Kirkland, Chuck Short
[Chuck Short]
35
    if response == True:
141 by Scott Moser
* debian/source_eucalyptus.py (LP: #541486):
36
        logs = { "Axis2c" : "axis2c.log",
37
                 "CC" : "cc.log",
38
                 "CloudDebug" : "cloud-debug.log",
39
                 "CloudOutput" : "cloud-output.log",
40
                 "HTTPDError" : "httpd-cc_error_log" }
41
42
        for (name,fname) in logs.iteritems():
43
            fpath = "%s/%s" % (logd, fname)
44
            if not os.path.exists(fpath): continue
45
            report["Eucalyptus%sLog" % name ] = (fpath, True)