linuxmuster / linuxmuster-linuxclient7

The new approach on connecting linuxclients to the Linuxmuster.net v7 Active Directory server.
3 stars 5 forks source link

Use Python API instead of system calls for apt #17

Closed dorianim closed 3 years ago

dorianim commented 3 years ago

For apt update and upgrade it is possible to use native python code instead of a system call: https://gist.github.com/yumminhuang/8b1502a49d8b20a6ae70

dorianim commented 3 years ago

Over here: https://github.com/linuxmuster/linuxmuster-linuxclient7/blob/4969e411fe80621d75eec27aed8d209b64da4056/usr/lib/python3/dist-packages/linuxmusterLinuxclient7/imageHelper.py#L69

kiarn commented 3 years ago

Another example : https://github.com/ajenti/ajenti/blob/master/plugins/packages/managers/apt_manager.py

dorianim commented 3 years ago

Thats cool! Do you also have something for systemd?

kiarn commented 3 years ago

In Ajenti we are still using subprocess to manage systemd : https://github.com/ajenti/ajenti/blob/master/plugins/services/managers/systemd_manager.py

I just found this : https://github.com/systemd/python-systemd, but I didn't try it, maybe it worth having an eye on it.

dorianim commented 3 years ago

Yes, I found that two, but it does not seem.to be very well maintained.

dorianim commented 3 years ago

I decided not to do this using native python as I couldn't get it to work in a reasonable amount of time.