rockstor / rockstor-core

Linux/BTRFS based Network Attached Storage(NAS)
http://rockstor.com/docs/contribute_section.html
GNU General Public License v3.0
559 stars 138 forks source link

Replace python-dbus with jeepney #2768

Open phillxnet opened 11 months ago

phillxnet commented 11 months ago

During #2744 we have: https://github.com/rockstor/rockstor-core/issues/2744#issuecomment-1810062592

@FroggyFlox & @Hooverdan96 I've just found the following upstream comment: https://gitlab.freedesktop.org/dbus/dbus-python/-/issues/48#note_2045548 from two months ago, as of this comment.

This project is only semi-maintained: merge requests welcome, but I am unlikely to be able to spend enough time on this to rewrite the tutorial.

As such we should look to limiting our use of this library, & ideally removing it in time.

I think users.py is currenlty the only user:

lbuildvm:/opt/rockstor/src # grep -R "import dbus" rockstor/system/users.py:import dbus

From @FroggyFlox comment https://github.com/rockstor/rockstor-core/issues/2728#issuecomment-1829931053

Interesting that it pulls jeepney as a dependency. This actually is my current top candidate to replace python-dbus (https://github.com/rockstor/rockstor-core/issues/2744#issuecomment-1810062592).

So it looks like our existing secondary dependency on jeepney, from our direct dependency on keyring-pass, is a nice convenient replacement for python-dbus.

PyPi: https://pypi.org/project/jeepney/ 0.8.0 Released: Apr 3, 2022 Requires: Python >=3.7

FroggyFlox commented 11 months ago

Thanks a lot for creating this issue. I thought I would share a few links from where my current interest in jeepney comes from: https://gitlab.freedesktop.org/dbus/dbus-python/-/commit/f74338c72b79af840d4755a821e421688a9743fb https://stackoverflow.com/a/76576713

The fact that keyring is using jeepney is reassuring and supports its use for our own needs. We'll have to establish some common functions to easily interact with it, but it seems to offer quite a few options: https://jeepney.readthedocs.io/en/latest/integrate.html

Of note, this issue should probably affect #2680 as we would thus rely on our jeepney use instead of pystemd.