Skip to content
Snippets Groups Projects
Commit e99953b6 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Avoid printing user.

parent 1d1d3711
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment