From 78068d2ffa91c9bef142d95d6e76af9d2c22cc5e Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Fri, 24 Apr 2020 10:23:20 +0200 Subject: [PATCH] python3 migration (because of 20.04) --- cron/libreschool-client | 2 +- debian/changelog | 6 ++++++ debian/control | 2 +- libreschool-client | 24 ++++++++++++++---------- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/cron/libreschool-client b/cron/libreschool-client index 9d19989..5f5aee9 100644 --- a/cron/libreschool-client +++ b/cron/libreschool-client @@ -1,3 +1,3 @@ */5 * * * * root /usr/sbin/libreschool-client -* */1 * * * root /usr/sbin/libreschool-client --with-inventory +15 */2 * * * root /usr/sbin/libreschool-client --with-inventory @reboot root /usr/sbin/libreschool-client diff --git a/debian/changelog b/debian/changelog index de4aa52..cb7661b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libreschool-client (1.0.2) UNRELEASED; urgency=medium + + * Migration to python3 + + -- paolo Mon, 24 Apr 2020 22:00:00 +0200 + libreschool-client (1.0.1) UNRELEASED; urgency=medium * Support for ubuntu 20.04 diff --git a/debian/control b/debian/control index 2db3dfd..849ed5b 100644 --- a/debian/control +++ b/debian/control @@ -8,6 +8,6 @@ Homepage: https://git.libreschool.org/LibreSchool/libreschool-client Package: libreschool-client Architecture: all -Depends: python | python-is-python2, python-configparser, python-requests, openssh-server, ${shlibs:Depends}, ${misc:Depends} +Depends: python3, python-configparser, python3-requests, python3-psutil, openssh-server, ${shlibs:Depends}, ${misc:Depends} Description: LibreSchool management client Managed by a LibreSchool server. diff --git a/libreschool-client b/libreschool-client index bc11e4c..b75fe20 100755 --- a/libreschool-client +++ b/libreschool-client @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import configparser import uuid @@ -10,7 +10,8 @@ import sys import socket import fileinput import json -import commands +import lsb_release +import psutil def get_default_gateway_linux(): """Read the default gateway directly from /proc.""" @@ -23,7 +24,6 @@ def get_default_gateway_linux(): return socket.inet_ntoa(struct.pack("