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 ...@@ -5,6 +5,7 @@ Environment setup script for MediaServer
''' '''
import imp import imp
import os import os
import subprocess
import sys import sys
import traceback import traceback
...@@ -64,8 +65,8 @@ class EnvSetup(): ...@@ -64,8 +65,8 @@ class EnvSetup():
self.debug = '-d' in args self.debug = '-d' in args
if self.debug: if self.debug:
args.remove('-d') args.remove('-d')
code, out = utils.exec_cmd(['whoami']) whoami = subprocess.check_output(['whoami']).decode('utf-8')
if out != 'root' and not self.debug: if whoami != 'root' and not self.debug:
log('This script should be run as root user.') log('This script should be run as root user.')
sys.exit(1) sys.exit(1)
# Load conf # Load conf
......
...@@ -60,8 +60,8 @@ class Tester(): ...@@ -60,8 +60,8 @@ class Tester():
debug = '-d' in args debug = '-d' in args
if debug: if debug:
args.remove('-d') args.remove('-d')
code, out = utils.exec_cmd(['whoami']) whoami = subprocess.check_output(['whoami']).decode('utf-8')
if out != 'root' and not debug: if whoami != 'root' and not debug:
log('This script should be run as root user.') log('This script should be run as root user.')
sys.exit(1) sys.exit(1)
# Load conf # 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