diff options
author | Lei YU <mine260309@gmail.com> | 2016-12-21 11:01:28 +0800 |
---|---|---|
committer | Lei YU <mine260309@gmail.com> | 2017-01-11 11:53:49 +0800 |
commit | 1d8b7cd1184a6038fc8dc77a41e29b37e7ab1402 (patch) | |
tree | a1593d88fde93e4da4872a880d2714341974f881 | |
parent | 371dd0248325954cec305f03167e06cf3997c9b1 (diff) | |
download | phosphor-settingsd-1d8b7cd1184a6038fc8dc77a41e29b37e7ab1402.tar.gz phosphor-settingsd-1d8b7cd1184a6038fc8dc77a41e29b37e7ab1402.zip |
Increase retry time and interval when calling get_subtree_paths()
In create_object(), mapper.get_subtree_paths() may raise DBusException
which is not handled, it will cause settings_manager failure.
This is a follow up commit after review #1751, where retry interval is
added as function parameter, so that it will sleep for an interval
between retries.
When calling get_subtree_paths(), use retry time 10 and sleep interval
0.1, so far the exception is not raised any more.
Make HostSettingsObject to inherit DbusObjectManager helps ObjectMapper
to get HostSettingsObject's info more efficiently, otherwise it falls
back to call Introspect.
Partially fix openbmc/openbmc#862
Change-Id: I87c856e372a20a0ad577ce52f099074cdf5a4355
Signed-off-by: Lei YU <mine260309@gmail.com>
-rw-r--r-- | settings_manager.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/settings_manager.py b/settings_manager.py index 0205ea5..cf358d8 100644 --- a/settings_manager.py +++ b/settings_manager.py @@ -7,7 +7,7 @@ import dbus.mainloop.glib import os import os.path as path import sys -from obmc.dbuslib.bindings import DbusProperties, get_dbus +from obmc.dbuslib.bindings import DbusProperties, DbusObjectManager, get_dbus from IPy import IP settings_file_path = os.path.join( @@ -68,7 +68,8 @@ def create_object(settings): for setting in settings.itervalues(): if setting['type'] is not 'instance_query': continue - paths = mapper.get_subtree_paths(setting['subtree'], 0) + paths = mapper.get_subtree_paths(setting['subtree'], 0, + retries=10, interval=0.1) if setting['keyregex'] == 'host': # Always create at least one host object. @@ -82,7 +83,7 @@ def create_object(settings): "/org/openbmc/settings/" + m.group(1), settings) return allobjects -class HostSettingsObject(DbusProperties): +class HostSettingsObject(DbusProperties, DbusObjectManager): def __init__(self, bus, name, settings, path): super(HostSettingsObject, self).__init__( conn=bus, |