-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setting invalid properties to connman service causes txdbus client to disconnect (cleanly) #45
Comments
testcase: #!/usr/bin/env python
from twisted.internet import reactor, defer
from txdbus import client
defer.setDebugging(True)
class VariantList(list):
dbusSignature = 'a(v)'
@defer.inlineCallbacks
def testcase():
conn = yield client.connect(reactor, 'system')
manager = yield conn.getRemoteObject('net.connman', '/')
services = yield manager.callRemote('GetServices', interface='net.connman.Manager')
service = None
for k, v in services:
if v['Type'] == 'ethernet':
service = k
break
if service is None:
print 'No ethernet service found'
reactor.stop()
defer.returnValue(None)
remote = yield conn.getRemoteObject('net.connman', service)
# params = ['8.8.8.8'] # ok with this value
params = ['8.8.8.8', '']
try:
yield remote.callRemote('SetProperty',
'Nameservers.Configuration',
VariantList(params),
interface='net.connman.Service')
finally:
reactor.stop()
print 'success'
if __name__ == '__main__':
reactor.callWhenRunning(testcase)
reactor.run() |
btw the signature for nameservers configuration it's simply alist |
My best guess is that what's happening here is that the data marshalling
code is sending something to the DBus daemon that isn't formatted correctly
and that's causing it to silently drop the connection. As to why the
marshalling code could be getting confused, I suspect it has something to
do with the VariantList class deriving from the built-in "list" class. I
wouldn't expect that to work since there are many places in the marshalling
code where "isinstance(obj,list)" is used to treat lists specially.
Is there another approach you can use that doesn't involve deriving from
'list'?
Tom
…On Tue, May 23, 2017 at 12:49 PM, Gianluigi Tiesi ***@***.***> wrote:
btw the signature for nameservers configuration it's simply alist
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#45 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABrLfP2gh3DZXKCCH5gqzc-YAmRdUQL5ks5r8xwOgaJpZM4NilE3>
.
|
the correct way to pass domains lists and dns lists is a simpe list, I made by mistake VariantList because I need this structure to pass IPv4 settings: class VariantDict(dict):
dbusSignature = 'a{sv}' perhaps It's not a good idea to have a connection dropped if there is an error, because I need to reregister signals etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to call
SetProperty
of a connman service, and it works fine if params are ok, when I use invalid params txdbus client apparently disconnects cleanlyI've defined a custom datatype:
here is the debug log:
and the dbus monitor output:
The text was updated successfully, but these errors were encountered: