diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-08-24 10:07:48 +0300 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-08-24 10:07:48 +0300 |
commit | a70d3f379e7551851cffffcdd77410210235c47c (patch) | |
tree | 1aa148ca6f506e2afe48d850e542931357a1357f /scripts/dpdk_setup_ports.py | |
parent | 8634fdc567b948b35c2a87cea4679aff3995cba6 (diff) |
better logger for master_daemon
verify root priveleges in dpdk_* scripts
call to functions of show status instead of calling process
Diffstat (limited to 'scripts/dpdk_setup_ports.py')
-rwxr-xr-x | scripts/dpdk_setup_ports.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/dpdk_setup_ports.py b/scripts/dpdk_setup_ports.py index 1bbf5b3a..84c44e4a 100755 --- a/scripts/dpdk_setup_ports.py +++ b/scripts/dpdk_setup_ports.py @@ -13,6 +13,7 @@ import shlex import traceback from collections import defaultdict, OrderedDict from distutils.util import strtobool +import getpass class ConfigCreator(object): mandatory_interface_fields = ['Slot_str', 'src_mac', 'dest_mac', 'Device_str', 'NUMA'] @@ -678,12 +679,12 @@ def main (): process_options () if map_driver.args.show: - res=os.system('%s dpdk_nic_bind.py --status' % sys.executable); - return(res); + dpdk_nic_bind.show_status() + return if map_driver.args.table: - res=os.system('%s dpdk_nic_bind.py -t' % sys.executable); - return(res); + dpdk_nic_bind.show_table() + return obj =CIfMap(map_driver.cfg_file); @@ -701,5 +702,8 @@ def main (): exit(-1) if __name__ == '__main__': + if getpass.getuser() != 'root': + print('Please run this program as root/with sudo') + exit(1) main() |