diff options
author | Hanoh Haim <hhaim@cisco.com> | 2015-06-24 14:03:29 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2015-06-24 14:03:29 +0300 |
commit | 8b52a31ed2c299b759f330c4f976b9c70f5765f4 (patch) | |
tree | 9d6da5438b5b56b1d2d57e6c13494b4e65d000e7 /scripts/daemon_server |
first version
Diffstat (limited to 'scripts/daemon_server')
-rwxr-xr-x | scripts/daemon_server | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/daemon_server b/scripts/daemon_server new file mode 100755 index 00000000..90fc614d --- /dev/null +++ b/scripts/daemon_server @@ -0,0 +1,27 @@ +#!/usr/bin/python + +import os +import sys + +core = 0 + +if '--core' in sys.argv: + try: + idx = sys.argv.index('--core') + core = int(sys.argv[idx + 1]) + if core > 31 or core < 0: + print "Error: please provide core argument between 0 to 31" + exit(-1) + del sys.argv[idx:idx+2] + except IndexError: + print "Error: please make sure core option provided with argument" + exit(-1) + except ValueError: + print "Error: please make sure core option provided with integer argument" + exit(-1) + +str_argv = ' '.join(sys.argv[1:]) +cmd = "taskset -c {core} python automation/trex_control_plane/server/trex_daemon_server.py {argv}".format(core = core, argv = str_argv) +os.system(cmd) + + |