diff options
author | Brad Bishop <bradleyb@us.ibm.com> | 2015-11-09 18:41:28 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@us.ibm.com> | 2015-11-09 18:42:51 -0500 |
commit | ae0c0afa9e9122549b67463ea1729aaa7c06d25e (patch) | |
tree | 45db33db26dff51efef04daf238392cc11f649ba /phosphor-mapper | |
parent | a052e8251b59c17a04983c596111294cc0915175 (diff) | |
download | phosphor-objmgr-ae0c0afa9e9122549b67463ea1729aaa7c06d25e.tar.gz phosphor-objmgr-ae0c0afa9e9122549b67463ea1729aaa7c06d25e.zip |
Make MapperNotFound a proper dbus exception
Set the name to org.openbmc.objectmapper.Error.NotFound
Diffstat (limited to 'phosphor-mapper')
-rw-r--r-- | phosphor-mapper | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/phosphor-mapper b/phosphor-mapper index 36bf09b..011dc56 100644 --- a/phosphor-mapper +++ b/phosphor-mapper @@ -16,14 +16,20 @@ # implied. See the License for the specific language governing # permissions and limitations under the License. -import sys import dbus import dbus.service +import dbus.exceptions import dbus.mainloop.glib import gobject -from OpenBMCMapper import Path, IntrospectionParser, PathTree +from OpenBMCMapper import IntrospectionParser, PathTree import OpenBMCMapper +class MapperNotFoundException(dbus.exceptions.DBusException): + _dbus_error_name = OpenBMCMapper.MAPPER_NOT_FOUND + def __init__(self, path): + super(MapperNotFoundException, self).__init__( + "path or object not found: %s" %(path)) + class ObjectMapper(dbus.service.Object): def __init__(self, bus, path, name_match = OpenBMCMapper.org_dot_openbmc_match, |