summaryrefslogtreecommitdiffstats
path: root/scripts/dpdk_nic_bind.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-12-20 17:47:22 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-12-20 17:47:22 +0200
commit539de1c6af63071c1da9ed5db668c500f8993a03 (patch)
treefa3562e40c925f7c9934a1d75f2a70cfec5f3b56 /scripts/dpdk_nic_bind.py
parent72d312651fbd011baffad2a3444866abb856c9ba (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/dpdk_nic_bind.py')
-rwxr-xr-xscripts/dpdk_nic_bind.py3
1 files changed, 1 insertions, 2 deletions
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()