From 889212e51098fc2e8ca5592a8c8f946ee8497d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Wed, 25 Jan 2017 18:11:18 +0100 Subject: [PATCH] Fixed a bug in whoami check. --- envsetup.py | 2 +- tester.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/envsetup.py b/envsetup.py index 40ac86e4..1676e2ac 100755 --- a/envsetup.py +++ b/envsetup.py @@ -65,7 +65,7 @@ class EnvSetup(): self.debug = '-d' in args if self.debug: args.remove('-d') - whoami = subprocess.check_output(['whoami']).decode('utf-8') + whoami = subprocess.check_output(['whoami']).decode('utf-8').strip() if whoami != 'root' and not self.debug: log('This script should be run as root user.') sys.exit(1) diff --git a/tester.py b/tester.py index c593cb7a..2d4e75e6 100755 --- a/tester.py +++ b/tester.py @@ -60,7 +60,7 @@ class Tester(): debug = '-d' in args if debug: args.remove('-d') - whoami = subprocess.check_output(['whoami']).decode('utf-8') + whoami = subprocess.check_output(['whoami']).decode('utf-8').strip() if whoami != 'root' and not debug: log('This script should be run as root user.') sys.exit(1) -- GitLab