From 539de1c6af63071c1da9ed5db668c500f8993a03 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Tue, 20 Dec 2016 17:47:22 +0200 Subject: 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 --- scripts/dpdk_nic_bind.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts/dpdk_nic_bind.py') diff --git a/scripts/dpdk_nic_bind.py b/scripts/dpdk_nic_bind.py index e797666b..6dec60cb 100755 --- a/scripts/dpdk_nic_bind.py +++ b/scripts/dpdk_nic_bind.py @@ -41,7 +41,6 @@ import texttable sys.path.remove(text_tables_path) import re import termios -import getpass # The PCI device class for ETHERNET devices ETHERNET_CLASS = "0200" @@ -729,7 +728,7 @@ def main(): do_arg_actions() if __name__ == "__main__": - if getpass.getuser() != 'root': + if os.getuid() != 0: print('Please run this program as root/with sudo') exit(1) main() -- cgit 1.2.3-korg