attach_root_command_outputs creates empty entries if no output from command

Bug #813798 reported by Bryce Harrington
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

See bug 813791 as an example.

Since the display manager log files are only readable by the superuser, we have to prompt for sudo password. Since there are several log files (and we want them attached as separate files to the bug report), to prevent prompting the user multiple times, we do this in one call:

            attach_root_command_outputs(report, {
                'GdmLog': 'cat /var/log/gdm/:0.log',
                'GdmLog1': 'cat /var/log/gdm/:0.log.1',
                'GdmLog2': 'cat /var/log/gdm/:0.log.2',
                'LightdmLog': 'cat /var/log/lightdm/lightdm.log',
                'LightdmDisplayLog': 'cat /var/log/lightdm/:0.log',
  'LightdmGreeterLog': 'cat /var/log/lightdm/:0-greeter.log',
                })

With the introduction of lightdm we now have two possible sets of log files, but it's likely the user will only have one set or the other. Unfortunately, in this case whichever set is missing will show up in the bug report as three empty fields.

As well, if a bug occurred on the user's first boot with gdm, they might not have :0.log.1 or .2.

attach_root_command_outputs() should have a way to prevent empty entries from being added.

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 1.21.3-0ubuntu1

---------------
apport (1.21.3-0ubuntu1) oneiric; urgency=low

  * New upstream bug fix release. Changes since our previous snapshot:
    - Add apport.packaging.get_library_paths() interface and implement it for
      backends/packaging-apt-dpkg.py using dpkg multiarch directories. Use it
      in chroot.py. This unbreaks apport-chroot for oneiric.
    - hookutils.py: Don't attach empty values. Thanks Bryce Harrington.
      (LP: #813798)
    - apport-gtk: Correctly pass message dialog type.
    - apport-gtk: Fix GLib and GObject imports to be compatible with the future
      pygobject 3.0.
    - hookutils.py, attach_alsa(): Get a list of outputs/inputs that PulseAudio
      knows about, which also shows the currently selected output/input, as well
      as volumes. This should help with "no sound" bug troubleshooting. Thanks
      Luke Yelavich.
  * data/general-hooks/ubuntu.py: Fix crash if report doesn't have a Package
    field (caught by test suite).
  * data/general-hooks/ubuntu.py: Fix crash if report doesn't have a
    DpkgTerminalLog field (caught by test suite).
 -- Martin Pitt <email address hidden> Wed, 17 Aug 2011 08:42:18 +0200

Changed in apport (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.