From 65aadef54654e6778f128fd85a60ba12080de950 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 3 Sep 2016 11:40:03 +0530 Subject: [PATCH] actions: Hush some unneeded output of systemd --- CHANGELOG.md | 1 + plinth/action_utils.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f74ed133a..ace6adbe4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ All notable changes to this project will be documented in this file. root is required, so that Plinth can run as non-root. - xmpp: Switched to using ruamel.yaml to modify ejabberd config. - Exit with error if any of the setup steps fail. +- actions: Hush some unneeded output of systemd. ## [0.10.0] - 2016-08-12 ### Added diff --git a/plinth/action_utils.py b/plinth/action_utils.py index fbf5e285e..3952728d4 100644 --- a/plinth/action_utils.py +++ b/plinth/action_utils.py @@ -59,7 +59,8 @@ def service_is_running(servicename): def service_is_enabled(service_name): """Check if service is enabled in systemd.""" try: - subprocess.check_output(['systemctl', 'is-enabled', service_name]) + subprocess.run(['systemctl', 'is-enabled', service_name], check=True, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) return True except subprocess.CalledProcessError: return False