I am going through dbus-python tutorial.
https://dbus.freedesktop.org/doc/dbus-python/tutorial.html#interfaces-and-methods
The example provided does not work for me. I replaced the eth0 with 1 but still it throws an error.
import dbus
bus = dbus.SystemBus()
eth0 = bus.get_object('org.freedesktop.NetworkManager',
'/org/freedesktop/NetworkManager/Devices/eth0')
eth0_dev_iface = dbus.Interface(eth0,
dbus_interface='org.freedesktop.NetworkManager.Devices')
props = eth0_dev_iface.getProperties()
Error:
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send
message, 2 matched rules; type="method_call", sender=":1.4371" (uid=78105 pid=8231
comm="python3 " label="unconfined") interface="org.freedesktop.NetworkManager.Devices"
member="getProperties" error name="(unset)" requested_reply="0" destination=":1.11"
(uid=0 pid=1122 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined")
Also there is this below statement
For instance, each NetworkManager object representing a network interface implements the interface org.freedesktop.NetworkManager.Devices
, which has methods like getProperties
.
I checked with d-feet, somehow the interface of network manager does not have getProperties
method