python-networkmanager icon indicating copy to clipboard operation
python-networkmanager copied to clipboard

Registering on device OnPropertiesChanged signal, register on the wrong interface.

Open yoavmarom opened this issue 7 years ago • 3 comments

After registering on a device, obtained using GetDevices function, the key on which the callback is registered is: ('org.freedesktop.NetworkManager.Device.Statistics', 'PropertiesChanged') While it should be ('org.freedesktop.NetworkManager.Device', 'PropertiesChanged')

  • this is a degradation from a previous version, although not sure how previous.

Example: In [1]: import NetworkManager In [2]: NetworkManager.NetworkManager.GetDevices() Out[2]: [<NetworkManager.Modem at 0x7f4a8b3c1710>] In[3]: device = NetworkManager.NetworkManager.GetDevices()[0] In[4]: device.OnPropertiesChanged(lambda:None)

yoavmarom avatar Jul 09 '19 13:07 yoavmarom

The root cause of the change is this line:

  • interface_names = ['org.freedesktop.NetworkManager.Device', 'org.freedesktop.NetworkManager.Device.Statistics']

yoavmarom avatar Jul 09 '19 13:07 yoavmarom

I just ran into this issue too. It seems to have been introduced in this commit nearly 2 years ago.

https://github.com/seveas/python-networkmanager/commit/c92cbd936da35cf9c9654db0d533e4775912af76

Removing org.freedesktop.NetworkManager.Device.Statistics from that list seems to fix it. I wonder why it was added in the first place?

gfrung4 avatar Oct 03 '19 19:10 gfrung4

Closing all PR's and issues prior to archiving this repository.

seveas avatar Jan 27 '23 20:01 seveas