upstart-monitor cannot run without gtk libraries installed

Bug #1235245 reported by James Hunt on 2013-10-04
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Cameron Norman
upstart (Ubuntu)

Bug Description

"upstart-monitor -n" should revert to cli operation. It attempts to do this, but then barfs on class UpstartEventsGui(Gtk.Window) since Gtk is not imported unless the required gtk libraries are installed.

Barry Warsaw (barry) wrote :

I took a quick look at lp:upstart and it shouldn't be too hard to fix this. There are several classic approaches to doing this, but I think the easiest way is to simply move UpstartEventsGui into a separate module which only gets imported in the `else` clause at the bottom of main(). That's the only reference to this class, and by then you know you have Gtk. Yes, it's perfectly fine to embed an import right there:

        from .upstart_gui import UpstartEventsGui
        win = UpstartEventsGui()

(then you'd move UpstartEventsGui to in that directory.)

Barry Warsaw (barry) wrote :

Oh, and minor style issue while I'm here. :)

`if cli == True:` is better written just `if cli:`

We generally don't test explicit equality against True or False.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in upstart (Ubuntu):
status: New → Confirmed
Jari Turkia (jari-e) wrote :

Because systemd, apparently nobody ever bothered to fix this.

Here is my patch to make CLI working.

The attachment "upstart-monitor.cli.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Cameron Norman (cameronnemo) wrote :
Changed in upstart:
assignee: nobody → Cameron Norman (cameronnemo)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments