dbus-python tutorial error in Network Interface example

John Whitmore arigead at gmail.com
Thu Oct 15 03:18:36 PDT 2015


I'm only starting out and trying to get my head around this to start using the
ModemManager API. I was trying to work through the tutorial for python use of
D-Bus at http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html

One of the first examples is:

    import dbus
    bus = dbus.SystemBus()
    eth0 = bus.get_object('org.freedesktop.NetworkManager',
                          '/org/freedesktop/NetworkManager/Devices/eth0')
    props = eth0.getProperties(dbus_interface='org.freedesktop.NetworkManager.Devices')

I'm using a different interface name as my distro isn't using "eth0" but even
so that last line "getProperties" fails:

dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "getProperties" with signature "" on interface "org.freedesktop.NetworkManager.Devices" doesn't exist


I then went off looking at the documentated API at:

https://developer.gnome.org/NetworkManager/unstable/spec.html#org.freedesktop.NetworkManager

That confuses me even more because it appears that NetworkManager doesn't have
a "Devices" Interface but rather a "Devices" Property. That can't be right
because the previous line in the example code:

    eth0 = bus.get_object('org.freedesktop.NetworkManager',
                          '/org/freedesktop/NetworkManager/Devices/eth0')

Does work?

OK I've got a lot to read and a lot to learn but if the example given in the
documentation doesn't work I'm going to be more confused then I already am.



More information about the dbus mailing list