Ejemplo n.º 1
0
def add_info(report, ui):
    # always attach these files
    attach_conffiles(report, 'unattended-upgrades', ui=ui)
    attach_conffiles(report, 'update-notifier-common', ui=ui)
    attach_file_if_exists(
        report, '/var/log/unattended-upgrades/unattended-upgrades.log')
    attach_file_if_exists(report, '/var/log/apt/history.log')
Ejemplo n.º 2
0
def add_info(report, ui):

    problem_type = report.get("ProblemType", None)
    if problem_type == "Bug":
        response = ui.yesno("Is the issue you are reporting one you \
encountered when upgrading Ubuntu from one release to another?")
    else:
        response = None
    if response:
        os.execlp('apport-bug', 'apport-bug', 'ubuntu-release-upgrader')
    else:
        try:
            attach_gsettings_package(report, 'update-manager')
        except:
            pass
        attach_file_if_exists(report, '/var/log/apt/history.log',
                              'DpkgHistoryLog.txt')
        attach_file_if_exists(report, '/var/log/apt/term.log',
                              'DpkgTerminalLog.txt')
        attach_root_command_outputs(
            report, {
                'CurrentDmesg.txt':
                'dmesg | comm -13 --nocheck-order /var/log/dmesg -'
            })
        report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
Ejemplo n.º 3
0
def add_info(report, ui):

    problem_type = report.get("ProblemType", None)
    if problem_type == "Bug":
        response = ui.yesno("Is the issue you are reporting one you \
encountered when upgrading Ubuntu from one release to another?")
    else:
        response = None
    if response:
        os.execlp('apport-bug', 'apport-bug', 'ubuntu-release-upgrader')
    else:
        attach_gsettings_package(report, 'update-manager')
        attach_file_if_exists(report, '/var/log/apt/history.log',
                              'DpkgHistoryLog.txt')
        attach_file_if_exists(report, '/var/log/apt/term.log',
                              'DpkgTerminalLog.txt')
        attach_root_command_outputs(
            report, {
                'CurrentDmesg.txt':
                'dmesg | comm -13 --nocheck-order /var/log/dmesg -'
            })
        if command_available('hwe-support-status'):
            # not using apport's command_output because it doesn't expect a
            # return code of 10
            unsupported = run_hwe_command('--show-all-unsupported')
            if unsupported:
                report['HWEunsupported'] = unsupported
                report['HWEreplacements'] = \
                    run_hwe_command('--show-replacements')
        report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
Ejemplo n.º 4
0
def add_info(report, ui):
    attach_file(report, '/proc/version_signature', 'ProcVersionSignature')
    attach_file(report, '/proc/cmdline', 'ProcKernelCmdline')

    sec_re = re.compile('audit\(|apparmor|selinux|security', re.IGNORECASE)
    report['KernLog'] = recent_kernlog(sec_re)
    # DBus messages are reported to syslog
    dbus_sec_re = re.compile('dbus.* apparmor', re.IGNORECASE)
    report['Syslog'] = recent_syslog(dbus_sec_re)

    packages = [
        'apparmor', 'apparmor-utils', 'libapparmor1', 'libapparmor-dev',
        'libapparmor-perl', 'apparmor-utils', 'apparmor-docs',
        'apparmor-profiles', 'apparmor-easyprof', 'python3-apparmor',
        'python-apparmor', 'libpam-apparmor', 'libapache2-mod-apparmor',
        'python3-libapparmor', 'python-libapparmor', 'auditd', 'libaudit0'
    ]

    versions = ''
    for package in packages:
        try:
            version = packaging.get_version(package)
        except ValueError:
            version = 'N/A'
        if version is None:
            version = 'N/A'
        versions += '%s %s\n' % (package, version)
    report['ApparmorPackages'] = versions

    # These need to be run as root
    report['ApparmorStatusOutput'] = root_command_output(
        ['/usr/sbin/apparmor_status'])
    report['PstreeP'] = command_output(['/usr/bin/pstree', '-p'])
    attach_file_if_exists(report, '/var/log/audit/audit.log', 'audit.log')
Ejemplo n.º 5
0
def add_info(report):
    if report['ProblemType'] == 'Package':
        # To detect if root fs is a loop device
        attach_file(report, '/proc/cmdline', 'ProcCmdLine')
        attach_default_grub(report, 'EtcDefaultGrub')
        attach_file_if_exists(report, '/boot/grub/device.map', 'DeviceMap')
        try:
            grub_d = '/etc/default/grub.d'
            for name in sorted(os.listdir(grub_d)):
                if name.endswith('.cfg'):
                    key = 'EtcDefaultGrubD.' + path_to_key(name)
                    attach_file_if_exists(report, os.path.join(grub_d, name),
                                          key)
        except OSError:
            pass

        invalid_grub_script = []
        if not check_shell_syntax_harder('/etc/default/grub'):
            invalid_grub_script.append('/etc/default/grub')

        # Check scripts in /etc/grub.d since some users directly change
        # configuration there
        grubdir = '/etc/grub.d'
        for f in os.listdir(grubdir):
            fullpath = os.path.join(grubdir, f)
            if f != 'README' and os.access(fullpath, os.X_OK) \
               and not check_shell_syntax(fullpath):
                invalid_grub_script.append(fullpath)
                attach_file(report, fullpath)

        # TODO: Add some UI to ask if the user modified the invalid script
        # and if he still wants to report it
        if invalid_grub_script:
            report['InvalidGrubScript'] = ' '.join(invalid_grub_script)
Ejemplo n.º 6
0
def add_info(report, ui):
    log_file = '/var/log/upstart/whoopsie.log'
    attach_file_if_exists(report, log_file, 'WhoopsieLog')

    reports = glob('/var/crash/*')
    if reports:
        report['CrashReports'] = command_output(
            ['stat', '-c', '%a:%u:%g:%s:%y:%x:%n'] + reports)
def add_info(report, ui):
    # always attach these files
    attach_conffiles(report, 'unattended-upgrades', ui=ui)
    attach_conffiles(report, 'update-notifier-common', ui=ui)
    attach_file_if_exists(
        report, '/var/log/unattended-upgrades/unattended-upgrades.log')
    attach_file_if_exists(
        report, '/var/log/apt/history.log')
Ejemplo n.º 8
0
def add_info(report):
    """Add info to the report."""

    # attach the log
    fname = logger.get_filename()
    attach_file_if_exists(report, fname, "MagicicadaLog")

    # which ubuntuone-client package version is installed
    attach_related_packages(report, ["ubuntuone-client"])
Ejemplo n.º 9
0
def add_info(report):
    HOME = os.environ.get('HOME', '/')
    CACHE_HOME = os.environ.get('XDG_CACHE_HOME', os.path.join(HOME, '.cache'))

    SUBMISSION = os.path.join(CACHE_HOME, 'checkbox', 'submission.xml')
    attach_file_if_exists(report, SUBMISSION)

    CHECKBOX_LOG = os.path.join(CACHE_HOME, 'checkbox', 'checkbox.log')
    attach_file_if_exists(report, CHECKBOX_LOG)
Ejemplo n.º 10
0
def add_info(report):
    """Add info to the report."""
    # attach the log
    fname = logger.get_filename()
    attach_file_if_exists(report, fname, "EncuentroLog")

    # info about dependencies
    packages = ["python-requests", "python-defer", "python-qt4", "python-xdg"]
    attach_related_packages(report, packages)
Ejemplo n.º 11
0
def add_info(report):
    HOME = os.environ.get('HOME', '/')
    CACHE_HOME = os.environ.get('XDG_CACHE_HOME',
        os.path.join(HOME, '.cache'))

    SUBMISSION = os.path.join(CACHE_HOME, 'checkbox', 'submission.xml')
    attach_file_if_exists(report, SUBMISSION)
    
    CHECKBOX_LOG = os.path.join(CACHE_HOME, 'checkbox', 'checkbox.log')
    attach_file_if_exists(report, CHECKBOX_LOG)
Ejemplo n.º 12
0
def add_info(report, ui):

    try:
        attach_gsettings_package(report, 'update-manager')
    except:
        pass
    attach_file_if_exists(report, '/var/log/apt/history.log',
                          'DpkgHistoryLog.txt')
    attach_file_if_exists(report, '/var/log/apt/term.log',
                          'DpkgTerminalLog.txt')
    attach_root_command_outputs(
        report,
        {'CurrentDmesg.txt':
            'dmesg | comm -13 --nocheck-order /var/log/dmesg -'})
    report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
Ejemplo n.º 13
0
def add_info(report, ui):
    # get info on all files in /var/crash/
    reports = glob('/var/crash/*')
    if reports:
        report['CrashReports'] = command_output(
            ['stat', '-c', '%a:%u:%g:%s:%y:%x:%n'] + reports)

    attach_related_packages(report, ['apport-noui'])
    # is the system set to autoreport crashes?
    if os.path.exists('/var/lib/apport/autoreport'):
        report['Tags'] += ' autoreport-true'
    else:
        report['Tags'] += ' autoreport-false'

    attach_file_if_exists(report, '/var/log/upstart/whoopsie.log')
def add_info(report):
    """add report info"""
    attach_file_if_exists(report, u1_except_log, "UbuntuOneSyncdaemonExceptionsLog")
    attach_file_if_exists(report, u1_invalidnames_log, "UbuntuOneSyncdaemonInvalidNamesLog")
    attach_file_if_exists(report, u1_usersd_conf, "UbuntuOneUserSyncdaemonConfig")
    attach_file_if_exists(report, u1_sd_conf, "UbuntuOneSyncdaemonConfig")

    if not apport.packaging.is_distro_package(report["Package"].split()[0]):
        report["ThirdParty"] = "True"
        report["CrashDB"] = "ubuntuone"
Ejemplo n.º 15
0
def add_info(report):
    attach_hardware(report)
    attach_file(report, '/proc/mounts', 'ProcMounts')
    attach_file_if_exists(report, '/etc/mdadm/mdadm.conf', 'mdadm.conf')
    attach_file(report, '/proc/mdstat', 'ProcMDstat')
    attach_file(report, '/proc/partitions', 'ProcPartitions')
    attach_file(report, '/etc/blkid.tab', 'etc.blkid.tab')
    attach_file_if_exists(report, '/boot/grub/menu.lst', 'GrubMenu.lst')
    attach_file_if_exists(report, '/boot/grub/grub.cfg', 'Grub.cfg')
    attach_file_if_exists(report, '/etc/lilo.conf', 'lilo.conf')

    devices = glob.glob("/dev/[hs]d*")
    for dev in devices:
        report['MDadmExamine' + path_to_key(dev)] = command_output(['/sbin/mdadm', '-E', dev])

    initrd_re = re.compile('md[a/]')
    report['initrd.files'] = get_initrd_files(initrd_re)
Ejemplo n.º 16
0
def add_info(report, ui):

    problem_type = report.get("ProblemType", None)
    if problem_type == "Bug":
        response = ui.yesno("Is the issue you are reporting one you \
encountered when upgrading Ubuntu from one release to another?")
    else:
        response = None
    if response:
        os.execlp('apport-bug', 'apport-bug', 'ubuntu-release-upgrader')
    else:
        try:
            attach_gsettings_package(report, 'update-manager')
        except:
            pass
        attach_file_if_exists(report, '/var/log/apt/history.log',
                              'DpkgHistoryLog.txt')
        attach_file_if_exists(report, '/var/log/apt/term.log',
                              'DpkgTerminalLog.txt')
        attach_root_command_outputs(
            report,
            {'CurrentDmesg.txt':
                'dmesg | comm -13 --nocheck-order /var/log/dmesg -'})
        report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
def add_info(report, ui):
    try:
        attach_gsettings_package(report, 'ubuntu-release-upgrader')
    except:
        pass
    report['CrashDB'] = 'ubuntu'
    report.setdefault('Tags', 'dist-upgrade')
    report['Tags'] += ' dist-upgrade'
    clone_file = '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'
    if os.path.exists(clone_file):
        report['VarLogDistupgradeAptclonesystemstate.tar.gz'] =  \
            root_command_output(["cat", clone_file], decode_utf8=False)
    attach_file_if_exists(report, '/var/log/dist-upgrade/apt.log',
        'VarLogDistupgradeAptlog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/apt-term.log',
        'VarLogDistupgradeApttermlog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/history.log',
        'VarLogDistupgradeAptHistorylog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/lspci.txt',
        'VarLogDistupgradeLspcitxt')
    attach_file_if_exists(report, '/var/log/dist-upgrade/main.log',
        'VarLogDistupgradeMainlog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/term.log',
        'VarLogDistupgradeTermlog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/screenlog.0',
        'VarLogDistupgradeScreenlog')
    attach_root_command_outputs(
        report,
        {'CurrentDmesg.txt':
            'dmesg | comm -13 --nocheck-order /var/log/dmesg -'})
    problem_type = report.get("ProblemType", None)
    if problem_type == 'Crash':
        tmpdir = re.compile('ubuntu-release-upgrader-\w+')
        tb = report.get("Traceback", None)
        if tb:
            dupe_sig = ''
            for line in tb.splitlines():
                scrub_line = tmpdir.sub('ubuntu-release-upgrader-tmpdir', line)
                dupe_sig += scrub_line + '\n'
            report["DuplicateSignature"] = dupe_sig
def add_info(report):
    report['CrashDB'] = "{'impl': 'launchpad', 'project': 'system76-driver'}"
    for (key, filename) in LOGS:
        attach_file_if_exists(report, filename, key)
Ejemplo n.º 19
0
def add_info(report):
    report['CrashDB'] = 'rednotebook'
    rednotebook_dir = path.join(os.environ['HOME'], '.rednotebook')
    for (key, name) in LOGS:
        log = path.join(rednotebook_dir, name)
        attach_file_if_exists(report, log, key)
Ejemplo n.º 20
0
def add_info(report):
    report['CrashDB'] = 'pogo'
    pogo_dir = path.join(os.environ['HOME'], '.config', 'pogo', 'Logs')
    for (key, name) in LOGS:
        log = path.join(pogo_dir, name)
        attach_file_if_exists(report, log, key)
Ejemplo n.º 21
0
def add_info(report):
    report["CrashDB"] = "rednotebook"
    rednotebook_dir = path.join(os.environ["HOME"], ".rednotebook")
    for (key, name) in LOGS:
        log = path.join(rednotebook_dir, name)
        attach_file_if_exists(report, log, key)
Ejemplo n.º 22
0
def add_info(report):
    report['CrashDB'] = 'pogo'
    pogo_dir = path.join(os.environ['HOME'], '.config', 'pogo', 'Logs')
    for (key, name) in LOGS:
        log = path.join(pogo_dir, name)
        attach_file_if_exists(report, log, key)
def add_info(report, ui):

    try:
        attach_gsettings_package(report, 'update-manager')
    except:
        pass
    response = ui.yesno(
        "Is the issue you are reporting one you encountered when upgrading Ubuntu from one release to another?"
    )
    if response:
        report.setdefault('Tags', 'dist-upgrade')
        report['Tags'] += ' dist-upgrade'
        attach_file_if_exists(
            report, '/var/log/dist-upgrade/apt-clone_system_state.tar.gz',
            'VarLogDistupgradeAptclonesystemstate.tar.gz')
        attach_file_if_exists(report, '/var/log/dist-upgrade/apt.log',
                              'VarLogDistupgradeAptlog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/apt-term.log',
                              'VarLogDistupgradeApttermlog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/history.log',
                              'VarLogDistupgradeAptHistorylog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/lspci.txt',
                              'VarLogDistupgradeLspcitxt')
        attach_file_if_exists(report, '/var/log/dist-upgrade/main.log',
                              'VarLogDistupgradeMainlog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/term.log',
                              'VarLogDistupgradeTermlog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/screenlog.0',
                              'VarLogDistupgradeScreenlog')
    elif response is None or response is False:
        attach_file_if_exists(report, '/var/log/apt/history.log',
                              'DpkgHistoryLog.txt')
        attach_file_if_exists(report, '/var/log/apt/term.log',
                              'DpkgTerminalLog.txt')
        attach_root_command_outputs(
            report, {
                'CurrentDmesg.txt':
                'dmesg | comm -13 --nocheck-order /var/log/dmesg -'
            })
        report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
def add_info(report):
    attach_file_if_exists(report,
        os.path.expanduser('~/.cache/software-center/software-center.log'),
        'SoftwareCenterLog')
def add_info(report):
    """add report info"""
    attach_file_if_exists(report, u1_except_log,
                                  "UbuntuOneSyncdaemonExceptionsLog")
    attach_file_if_exists(report, u1_invalidnames_log,
                                  "UbuntuOneSyncdaemonInvalidNamesLog")
    attach_file_if_exists(report, u1_oauth_log,
                                  "UbuntuOneOAuthLoginLog")
    attach_file_if_exists(report, u1_prefs_log,
                                  "UbuntuOnePreferencesLog")
    attach_file_if_exists(report, u1_usersd_conf,
                                  "UbuntuOneUserSyncdaemonConfig")
    attach_file_if_exists(report, u1_sd_conf,
                                  "UbuntuOneSyncdaemonConfig")
    attach_file_if_exists(report, u1_user_conf,
                                  "UbuntuOneClientConfig")

    if not apport.packaging.is_distro_package(report['Package'].split()[0]):
        report['ThirdParty'] = 'True'
        report['CrashDB'] = 'ubuntuone'

    packages = ['ubuntuone-client',
                'python-ubuntuone-client',
                'ubuntuone-client-tools',
                'ubuntuone-client-gnome',
                'python-ubuntuone-storageprotocol',
                'ubuntuone-ppa-beta']

    versions = ''
    for package in packages:
        try:
            version = packaging.get_version(package)
        except ValueError:
            version = 'N/A'
        if version is None:
            version = 'N/A'
        versions += '%s %s\n' % (package, version)
    report['UbuntuOneClientPackages'] = versions
Ejemplo n.º 26
0
def add_info(report, ui):
    arch = platform.machine()
    if arch not in ['ppc64', 'ppc64le']:
        return

    is_kernel = report['ProblemType'].startswith(
        'Kernel') or 'linux' in report.get('Package')

    try:
        with open('/proc/cpuinfo', 'r') as fp:
            contents = fp.read()
            ispSeries = 'pSeries' in contents
            isPowerNV = 'PowerNV' in contents
            isPowerKVM = 'emulated by qemu' in contents
    except IOError:
        ispSeries = False
        isPowerNV = False
        isPowerKVM = False

    if ispSeries or isPowerNV:
        if is_kernel:
            add_tar(report, '/proc/device-tree/', 'DeviceTree.tar')
        attach_file(report, '/proc/misc', 'ProcMisc')
        attach_file(report, '/proc/locks', 'ProcLocks')
        attach_file(report, '/proc/loadavg', 'ProcLoadAvg')
        attach_file(report, '/proc/swaps', 'ProcSwaps')
        attach_file(report, '/proc/version', 'ProcVersion')
        report['cpu_smt'] = command_output(['ppc64_cpu', '--smt'])
        report['cpu_cores'] = command_output(['ppc64_cpu', '--cores-present'])
        report['cpu_coreson'] = command_output(['ppc64_cpu', '--cores-on'])
        # To be executed as root
        if is_kernel:
            attach_root_command_outputs(
                report, {
                    'cpu_runmode': 'ppc64_cpu --run-mode',
                    'cpu_freq': 'ppc64_cpu --frequency',
                    'cpu_dscr': 'ppc64_cpu --dscr',
                    'nvram': 'cat /dev/nvram',
                })
        attach_file_if_exists(report, '/var/log/platform')

    if ispSeries and not isPowerKVM:
        attach_file(report, '/proc/ppc64/lparcfg', 'ProcLparCfg')
        attach_file(report, '/proc/ppc64/eeh', 'ProcEeh')
        attach_file(report, '/proc/ppc64/systemcfg', 'ProcSystemCfg')
        report['lscfg_vp'] = command_output(['lscfg', '-vp'])
        report['lsmcode'] = command_output(['lsmcode', '-A'])
        report['bootlist'] = command_output(['bootlist', '-m', 'both', '-r'])
        report['lparstat'] = command_output(['lparstat', '-i'])
        if command_available('lsvpd'):
            report['lsvpd'] = command_output(['lsvpd', '--debug'])
        if command_available('lsvio'):
            report['lsvio'] = command_output(['lsvio', '-des'])
        if command_available('servicelog'):
            report['servicelog_dump'] = command_output(
                ['servicelog', '--dump'])
        if command_available('servicelog_notify'):
            report['servicelo_list'] = command_output(
                ['servicelog_notify', '--list'])
        if command_available('usysattn'):
            report['usysattn'] = command_output(['usysattn'])
        if command_available('usysident'):
            report['usysident'] = command_output(['usysident'])
        if command_available('serv_config'):
            report['serv_config'] = command_output(['serv_config', '-l'])

    if isPowerNV:
        add_tar(report, '/proc/ppc64/', 'ProcPpc64.tar')
Ejemplo n.º 27
0
def add_info(report):
    report['CrashDB'] = 'rednotebook'
    rednotebook_dir = path.join(os.environ['HOME'], '.rednotebook')
    for (key, name) in LOGS:
        log = path.join(rednotebook_dir, name)
        attach_file_if_exists(report, log, key)
Ejemplo n.º 28
0
def add_info(report, ui):
    arch = platform.machine()
    if arch not in ["ppc64", "ppc64le"]:
        return

    is_kernel = report["ProblemType"].startswith("Kernel") or "linux" in report.get("Package")

    try:
        with open("/proc/cpuinfo", "r") as fp:
            contents = fp.read()
            ispSeries = "pSeries" in contents
            isPowerNV = "PowerNV" in contents
            isPowerKVM = "emulated by qemu" in contents
    except IOError:
        ispSeries = False
        isPowerNV = False
        isPowerKVM = False

    if ispSeries or isPowerNV:
        if is_kernel:
            add_tar(report, "/proc/device-tree/", "DeviceTree.tar")
        attach_file(report, "/proc/misc", "ProcMisc")
        attach_file(report, "/proc/locks", "ProcLocks")
        attach_file(report, "/proc/loadavg", "ProcLoadAvg")
        attach_file(report, "/proc/swaps", "ProcSwaps")
        attach_file(report, "/proc/version", "ProcVersion")
        report["cpu_smt"] = command_output(["ppc64_cpu", "--smt"])
        report["cpu_cores"] = command_output(["ppc64_cpu", "--cores-present"])
        report["cpu_coreson"] = command_output(["ppc64_cpu", "--cores-on"])
        # To be executed as root
        if is_kernel:
            attach_root_command_outputs(
                report,
                {
                    "cpu_runmode": "ppc64_cpu --run-mode",
                    "cpu_freq": "ppc64_cpu --frequency",
                    "cpu_dscr": "ppc64_cpu --dscr",
                    "nvram": "cat /dev/nvram",
                },
            )
        attach_file_if_exists(report, "/var/log/platform")

    if ispSeries and not isPowerKVM:
        attach_file(report, "/proc/ppc64/lparcfg", "ProcLparCfg")
        attach_file(report, "/proc/ppc64/eeh", "ProcEeh")
        attach_file(report, "/proc/ppc64/systemcfg", "ProcSystemCfg")
        report["lscfg_vp"] = command_output(["lscfg", "-vp"])
        report["lsmcode"] = command_output(["lsmcode", "-A"])
        report["bootlist"] = command_output(["bootlist", "-m", "both", "-r"])
        report["lparstat"] = command_output(["lparstat", "-i"])
        if command_available("lsvpd"):
            report["lsvpd"] = command_output(["lsvpd", "--debug"])
        if command_available("lsvio"):
            report["lsvio"] = command_output(["lsvio", "-des"])
        if command_available("servicelog"):
            report["servicelog_dump"] = command_output(["servicelog", "--dump"])
        if command_available("servicelog_notify"):
            report["servicelo_list"] = command_output(["servicelog_notify", "--list"])
        if command_available("usysattn"):
            report["usysattn"] = command_output(["usysattn"])
        if command_available("usysident"):
            report["usysident"] = command_output(["usysident"])
        if command_available("serv_config"):
            report["serv_config"] = command_output(["serv_config", "-l"])

    if isPowerNV:
        add_tar(report, "/proc/ppc64/", "ProcPpc64.tar")
Ejemplo n.º 29
0
def add_info(report):
    """add report info"""
    attach_file_if_exists(report, lyricue_config, "LyricueConfig")
    attach_file_if_exists(report, lyricue_frontend_log, "LyricueFrontendLog")
    attach_file_if_exists(report, lyricue_server_log, "LyricueServerLog")
    attach_file_if_exists(report, lyricue_preview_log, "LyricuePreviewLog")
    attach_file_if_exists(report, lyricue_frontend_old_log,
                          "LyricueFrontendOldLog")
    attach_file_if_exists(report, lyricue_server_old_log,
                          "LyricueServerOldLog")
    attach_file_if_exists(report, lyricue_preview_old_log,
                          "LyricuePreviewOldLog")
    attach_file_if_exists(report, '/var/log/Xorg.0.log', 'XorgLog')

    if os.environ.get('DISPLAY'):
        log = command_output(['xrandr', '-q'])
        if not log or log[:5] == "Error":
            return
        report['Xrandr'] = log

    if not apport.packaging.is_distro_package(report['Package'].split()[0]):
        report['ThirdParty'] = 'True'
        report['CrashDB'] = 'lyricue'

    packages = [
        'lyricue', 'libclutter-1.0-0', 'libclutter-gst-1.0-0',
        'libclutter-gtk-1.0-0', 'libclutter-gtk-0.10-0', 'mysql-server'
    ]

    versions = ''
    for package in packages:
        try:
            version = packaging.get_version(package)
        except ValueError:
            version = 'N/A'
        if version is None:
            version = 'N/A'
        versions += '%s %s\n' % (package, version)
    report['LyricuePackages'] = versions
Ejemplo n.º 30
0
def add_info(report, ui):

    try:
        attach_gsettings_package(report, 'update-manager')
    except:
        pass
    response = ui.yesno("Is the issue you are reporting one you encountered when upgrading Ubuntu from one release to another?")
    if response:
        report.setdefault('Tags', 'dist-upgrade')
        report['Tags'] += ' dist-upgrade'
        attach_file_if_exists(report, '/var/log/dist-upgrade/apt-clone_system_state.tar.gz',
            'VarLogDistupgradeAptclonesystemstate.tar.gz')
        attach_file_if_exists(report, '/var/log/dist-upgrade/apt.log',
            'VarLogDistupgradeAptlog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/apt-term.log',
            'VarLogDistupgradeApttermlog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/history.log',
            'VarLogDistupgradeAptHistorylog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/lspci.txt',
            'VarLogDistupgradeLspcitxt')
        attach_file_if_exists(report, '/var/log/dist-upgrade/main.log',
            'VarLogDistupgradeMainlog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/system_state.tar.gz',
            'VarLogDistupgradeSystemstate.tar.gz')
        attach_file_if_exists(report, '/var/log/dist-upgrade/term.log',
            'VarLogDistupgradeTermlog')
        attach_file_if_exists(report, '/var/log/dist-upgrade/screenlog.0',
            'VarLogDistupgradeScreenlog')
    elif response is None or response is False:
        attach_file_if_exists(report, '/var/log/apt/history.log',
            'DpkgHistoryLog.txt')
        attach_file_if_exists(report, '/var/log/apt/term.log',
            'DpkgTerminalLog.txt')
        attach_root_command_outputs(report,
            {'CurrentDmesg.txt': 'dmesg | comm -13 --nocheck-order /var/log/dmesg -'})
        report["Aptdaemon"] = recent_syslog(re.compile("AptDaemon"))
def add_info(report, ui):
    try:
        attach_gsettings_package(report, 'ubuntu-release-upgrader')
    except:
        pass
    report['CrashDB'] = 'ubuntu'
    report.setdefault('Tags', 'dist-upgrade')
    report['Tags'] += ' dist-upgrade'
    clone_file = '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'
    if os.path.exists(clone_file):
        report['VarLogDistupgradeAptclonesystemstate.tar.gz'] =  \
            root_command_output(["cat", clone_file], decode_utf8=False)
    attach_file_if_exists(report, '/var/log/dist-upgrade/apt.log',
        'VarLogDistupgradeAptlog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/apt-term.log',
        'VarLogDistupgradeApttermlog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/history.log',
        'VarLogDistupgradeAptHistorylog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/lspci.txt',
        'VarLogDistupgradeLspcitxt')
    attach_file_if_exists(report, '/var/log/dist-upgrade/main.log',
        'VarLogDistupgradeMainlog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/term.log',
        'VarLogDistupgradeTermlog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/xorg_fixup.log',
        'VarLogDistupgradeXorgFixuplog')
    attach_file_if_exists(report, '/var/log/dist-upgrade/screenlog.0',
        'VarLogDistupgradeScreenlog')
    attach_root_command_outputs(
        report,
        {'CurrentDmesg.txt':
            'dmesg | comm -13 --nocheck-order /var/log/dmesg -'})
    problem_type = report.get("ProblemType", None)
    if problem_type == 'Crash':
        tmpdir = re.compile('ubuntu-release-upgrader-\w+')
        tb = report.get("Traceback", None)
        if tb:
            dupe_sig = ''
            for line in tb.splitlines():
                scrub_line = tmpdir.sub('ubuntu-release-upgrader-tmpdir', line)
                dupe_sig += scrub_line + '\n'
            report["DuplicateSignature"] = dupe_sig
Ejemplo n.º 32
0
def add_info(report):
    """add report info"""
    attach_file_if_exists(report, lyricue_config,
                                  "LyricueConfig")
    attach_file_if_exists(report, lyricue_frontend_log,
                                  "LyricueFrontendLog")
    attach_file_if_exists(report, lyricue_server_log,
                                  "LyricueServerLog")
    attach_file_if_exists(report, lyricue_preview_log,
                                  "LyricuePreviewLog")
    attach_file_if_exists(report, lyricue_frontend_old_log,
                                  "LyricueFrontendOldLog")
    attach_file_if_exists(report, lyricue_server_old_log,
                                  "LyricueServerOldLog")
    attach_file_if_exists(report, lyricue_preview_old_log,
                                  "LyricuePreviewOldLog")
    attach_file_if_exists(report, '/var/log/Xorg.0.log', 'XorgLog')

    if os.environ.get('DISPLAY'):
        log = command_output(['xrandr', '-q'])
        if not log or log[:5] == "Error":
            return
        report['Xrandr'] = log

    if not apport.packaging.is_distro_package(report['Package'].split()[0]):
        report['ThirdParty'] = 'True'
        report['CrashDB'] = 'lyricue'

    packages = ['lyricue',
		'libclutter-1.0-0',
		'libclutter-gst-1.0-0',
		'libclutter-gtk-1.0-0',
		'libclutter-gtk-0.10-0',
		'mysql-server']

    versions = ''
    for package in packages:
        try:
            version = packaging.get_version(package)
        except ValueError:
            version = 'N/A'
        if version is None:
            version = 'N/A'
        versions += '%s %s\n' % (package, version)
    report['LyricuePackages'] = versions