[PATCH] Use systemd-localed for writing out xorg conf file (#958714)

Vratislav Podzimek vpodzime at redhat.com
Tue May 7 09:35:19 UTC 2013


On Mon, 2013-05-06 at 12:23 -0700, Brian C. Lane wrote:
> On Mon, May 06, 2013 at 06:02:59PM +0200, Vratislav Podzimek wrote:
> > Also use its file to write out configuration to the target system instead of our
> > own file nobody reads. The systemd-localed's configuration file is read by Gnome
> > and hopefully the other desktop environments as well.
> > 
> > Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> > ---
> >  pyanaconda/keyboard.py | 245 ++++++++++++++++++++++++++++++-------------------
> >  1 file changed, 153 insertions(+), 92 deletions(-)
> 
> > -    def set_and_convert_keymap(self, keymap):
> > +    @property
> > +    def keymap(self):
> > +        keymap = dbus_get_property_safe_sync(LOCALED_SERVICE,
> > +                                             LOCALED_OBJECT_PATH,
> > +                                             LOCALED_IFACE,
> > +                                             "VConsoleKeymap",
> > +                                             self._connection)
> > +
> 
> Are these various dbus_ calls guaranteed to return what's expected? If
> not I'd like to see some defaults returned instead of generating a
> traceback when they fail.
Good question! These could "fail" in two ways:
1) the DBusCallError is raised which means we are not able to talk to
systemd-localed or the API has changed which means our keyboard
configuration is doomed and we should have such bug reported and fixed,
or

2) an empty string is returned which should be okay, or

3) the DBusPropertyError is raised if there is no value for the
property. This one should be probably caught and an empty string should
be returned instead. Fixing locally.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list