diff options
author | 2016-12-20 17:47:22 +0200 | |
---|---|---|
committer | 2016-12-20 17:47:22 +0200 | |
commit | 539de1c6af63071c1da9ed5db668c500f8993a03 (patch) | |
tree | fa3562e40c925f7c9934a1d75f2a70cfec5f3b56 /scripts/trex_daemon_server | |
parent | 72d312651fbd011baffad2a3444866abb856c9ba (diff) |
Fix the way root user is being determined in Python; Running scapy_daemon_server and stl_rpc_proxy now should work without tty;
Change-Id: Id70be83956a9b8279197c68dd58b674e972fc1a9
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/trex_daemon_server')
-rwxr-xr-x | scripts/trex_daemon_server | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/trex_daemon_server b/scripts/trex_daemon_server index 514dbd2d..d7da283d 100755 --- a/scripts/trex_daemon_server +++ b/scripts/trex_daemon_server @@ -1,6 +1,6 @@ #!/usr/bin/python -import os, sys, getpass +import os, sys import tempfile from time import time, sleep import subprocess, shlex, multiprocessing @@ -11,7 +11,7 @@ def fail(msg): print(msg) sys.exit(-1) -if getpass.getuser() != 'root': +if os.getuid() != 0: fail('Please run this program as root/with sudo') sys.path.append(os.path.join('automation', 'trex_control_plane', 'server')) |