From b6f6863876e1359e48e8a33028e8ff3a82198ba8 Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 25 Oct 2018 22:21:51 +0200 Subject: [PATCH 1/2] add_dbus_warning_with_solution --- devices/linux/Files/main_new.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/devices/linux/Files/main_new.py b/devices/linux/Files/main_new.py index 0c1bd6b51..1f0707aa6 100644 --- a/devices/linux/Files/main_new.py +++ b/devices/linux/Files/main_new.py @@ -134,6 +134,22 @@ def run_installer(): NM_AVAILABLE = False if not NM_AVAILABLE: # no dbus so ask if the user will want wpa_supplicant config + + dbus_package = { + 'ubuntu': 'python3-dbus', + 'debian': 'python3-dbus', + 'fedora': 'python3-dbus', + 'opensuse': 'python3-dbus-python', + 'arch': 'python-dbus', + 'centos': 'dbus-python' + # I could extend this + } + package = dbus_package.get(get_system()[0], '') + + if package: + if installer_data.ask(Messages.dbus_missing, Messages.cont, 1): + installer_data.show_info(Messages.install_package.format(package)) + sys.exit(1) if installer_data.ask(Messages.save_wpa_conf, Messages.cont, 1): sys.exit(1) installer_data.get_user_cred() @@ -166,6 +182,7 @@ class Messages(object): cert_error = "Certificate file not found, looks like a CAT error" unknown_version = "Unknown version" dbus_error = "DBus connection problem, a sudo might help" + dbus_missing = "Do you want to install the dbus package to fix the error?" yes = "Y" nay = "N" p12_filter = "personal certificate file (p12 or pfx)" @@ -186,7 +203,8 @@ class Messages(object): user_cert_missing = "personal certificate file not found" # "File %s exists; it will be overwritten." # "Output written to %s" - + install_package = 'Please install the package {}. Then start the eduroam ' \ + 'linux installer again' class Config(object): """ From 6698512c48e7b8e177b40ee05442696e29a2b912 Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 25 Oct 2018 22:31:22 +0200 Subject: [PATCH 2/2] change distro names --- devices/linux/Files/main_new.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/devices/linux/Files/main_new.py b/devices/linux/Files/main_new.py index 1f0707aa6..a34f47b1b 100644 --- a/devices/linux/Files/main_new.py +++ b/devices/linux/Files/main_new.py @@ -136,12 +136,12 @@ def run_installer(): # no dbus so ask if the user will want wpa_supplicant config dbus_package = { - 'ubuntu': 'python3-dbus', - 'debian': 'python3-dbus', - 'fedora': 'python3-dbus', - 'opensuse': 'python3-dbus-python', - 'arch': 'python-dbus', - 'centos': 'dbus-python' + 'Ubuntu': 'python3-dbus', + 'Debian': 'python3-dbus', + 'Fedora': 'python3-dbus', + 'openSuse': 'python3-dbus-python', + 'Arch': 'python-dbus', + 'CentOS': 'dbus-python' # I could extend this } package = dbus_package.get(get_system()[0], '')