From e99953b6d1bb2cb8a4084c1e03247594caa096a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Wed, 25 Jan 2017 17:24:23 +0100 Subject: [PATCH] Avoid printing user. --- envsetup.py | 5 +++-- tester.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/envsetup.py b/envsetup.py index 2cc3f7a8..40ac86e4 100755 --- a/envsetup.py +++ b/envsetup.py @@ -5,6 +5,7 @@ Environment setup script for MediaServer ''' import imp import os +import subprocess import sys import traceback @@ -64,8 +65,8 @@ class EnvSetup(): self.debug = '-d' in args if self.debug: args.remove('-d') - code, out = utils.exec_cmd(['whoami']) - if out != 'root' and not self.debug: + whoami = subprocess.check_output(['whoami']).decode('utf-8') + if whoami != 'root' and not self.debug: log('This script should be run as root user.') sys.exit(1) # Load conf diff --git a/tester.py b/tester.py index 43b9cca1..1dbf7bf7 100755 --- a/tester.py +++ b/tester.py @@ -60,8 +60,8 @@ class Tester(): debug = '-d' in args if debug: args.remove('-d') - code, out = utils.exec_cmd(['whoami']) - if out != 'root' and not debug: + whoami = subprocess.check_output(['whoami']).decode('utf-8') + if whoami != 'root' and not debug: log('This script should be run as root user.') sys.exit(1) # Load conf -- GitLab