landscape-config should exit gracefully in the event of client startup or DBUS connection failures

Bug #274819 reported by Christopher Armstrong
2
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
Undecided
Christopher Armstrong
Landscape Server
Fix Released
Undecided
Christopher Armstrong

Bug Description

Right now ugly unknown error messages or tracebacks are printed when either

1. the client fails to be restarted (landscape-config calls /etc/init.d/landscape-client restart), or
2. DBus isn't running

They should be suppressed with nicer error messages and followed by an exit with code 2.

An --ok-no-register option should exist to allow the exit code 2 to be replaced with exit code 0 in the event of a failed registration.

Changed in landscape:
assignee: nobody → radix
status: New → In Progress
milestone: none → thames-pre-9
Changed in landscape-client:
assignee: nobody → radix
status: New → In Progress
Revision history for this message
Christopher Armstrong (radix) wrote :

The attached branch is based on trunk. Ready for review.

Revision history for this message
Thomas Herve (therve) wrote :

[1]
+def get_config(self, args):
+ if "--config" not in args:
+ filename = self.makeFile("""
+[client]
+url = https://landscape.canonical.com/message-system
+""")
+ args.extend(["--config", filename])
+ config = LandscapeSetupConfiguration()
+ config.load(args)
+ return config

It should have "self" as first parameter. Maybe you could pass the makeFile method directly, or create a Test mixin.

[2]
+ print_text("This machine will be registered with the provided "
+ "details when the client runs.", error=True)

The error message looks a bit unclear. I don't anything much better to propose though :/

+1!

Revision history for this message
Christopher Armstrong (radix) wrote :

I got +1 from Gustavo on this branch. Merged to trunk.

Changed in landscape-client:
status: In Progress → Fix Committed
Changed in landscape:
status: In Progress → Fix Committed
Changed in landscape-client:
status: Fix Committed → Fix Released
Changed in landscape:
status: Fix Committed → 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.