[yast-commit] r57769 - in /trunk/core: dbus/namespace_service/src/DBusModulesServer.cc dbus/namespace_service/testsuite/t3-unknown-method package/yast2-core.changes
Author: mvidner Date: Fri Jun 26 14:52:29 2009 New Revision: 57769 URL: http://svn.opensuse.org/viewcvs/yast?rev=57769&view=rev Log: yast_modules_dbus_server: return org.freedesktop.DBus.Error.UnknownMethod for unknown methods Added: trunk/core/dbus/namespace_service/testsuite/t3-unknown-method (with props) Modified: trunk/core/dbus/namespace_service/src/DBusModulesServer.cc trunk/core/package/yast2-core.changes Modified: trunk/core/dbus/namespace_service/src/DBusModulesServer.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/dbus/namespace_service/src/DBusModulesServer.cc?rev=57769&r1=57768&r2=57769&view=diff ============================================================================== --- trunk/core/dbus/namespace_service/src/DBusModulesServer.cc (original) +++ trunk/core/dbus/namespace_service/src/DBusModulesServer.cc Fri Jun 26 14:52:29 2009 @@ -404,12 +404,14 @@ constTypePtr t = searchFuncType(object, method); constTypePtr rettype = NULL; + bool found = false; if (t) { constFunctionTypePtr fptr(t); if (fptr) { + found = true; rettype = fptr->returnType(); int reqarg = fptr->parameterCount(); @@ -498,14 +500,18 @@ y2error("Function %s::%s got %d parameters instead of %d", object.c_str(), method.c_str(), request.arguments(), fptr->parameterCount()); } } - else - { - y2internal("Function %s::%s was not found although it was registered", object.c_str(), method.c_str()); - } } - else + + if (!found) { y2internal("Function %s::%s was not found although it was registered", object.c_str(), method.c_str()); + string msg = "Method '"+ interface + "." + method + "' " + "on object '" + object + "' doesn't exist"; + // anyway, why didnt dbus itself cry? + reply.createError(request, // in reply to + msg, + "org.freedesktop.DBus.Error.UnknownMethod"); + return reply; } reply.createReply(request); Added: trunk/core/dbus/namespace_service/testsuite/t3-unknown-method URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/dbus/namespace_service/testsuite/t3-unknown-method?rev=57769&view=auto ============================================================================== --- trunk/core/dbus/namespace_service/testsuite/t3-unknown-method (added) +++ trunk/core/dbus/namespace_service/testsuite/t3-unknown-method Fri Jun 26 14:52:29 2009 @@ -0,0 +1,15 @@ +#! /usr/bin/python +# test calling an unknown method +import sys +import dbus +T_o = dbus.SessionBus().get_object('org.opensuse.YaST.modules', + '/org/opensuse/YaST/modules/TEST') +T = dbus.Interface(T_o, 'org.opensuse.YaST.Values') +try: + T.NoSuchMethod() +except dbus.exceptions.DBusException, e: + if e.get_dbus_name() == 'org.freedesktop.DBus.Error.UnknownMethod': + print e + sys.exit(0) + raise # Unexpected DBusException +assert False # We should have got an exception instead Modified: trunk/core/package/yast2-core.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?rev=57769&r1=57768&r2=57769&view=diff ============================================================================== --- trunk/core/package/yast2-core.changes (original) +++ trunk/core/package/yast2-core.changes Fri Jun 26 14:52:29 2009 @@ -1,6 +1,8 @@ ------------------------------------------------------------------- -Fri Jun 26 14:49:59 CEST 2009 - mvidner@suse.cz +Fri Jun 26 14:52:05 CEST 2009 - mvidner@suse.cz +- yast_modules_dbus_server: return org.freedesktop.DBus.Error.UnknownMethod + for unknown methods - Disable --as-needed until this package is fixed. ------------------------------------------------------------------- -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mvidner@svn.opensuse.org