diff options
author | 2016-06-13 11:04:35 -0700 | |
---|---|---|
committer | 2016-06-13 11:04:35 -0700 | |
commit | 64eec6741cea5e4b4dd9fe859a36b46b8e353889 (patch) | |
tree | 8e735438a3fafeb0e8f73063a1a17e315908b463 /domino-cli.py | |
parent | 069277d5ac5cbd1b8e84bb15ed766825aa8059d3 (diff) |
Added cliport support for domino-cli.py to be able to run multiple domino clients in non-interactive mode
Change-Id: I38dd5061d60739ba2e37c50e8887abe69fa0b137
Signed-off-by: Ulas Kozat <ulas.kozat@gmail.com>
Diffstat (limited to 'domino-cli.py')
-rwxr-xr-x | domino-cli.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/domino-cli.py b/domino-cli.py index 3edf22c..5e55d38 100755 --- a/domino-cli.py +++ b/domino-cli.py @@ -12,6 +12,7 @@ # limitations under the License. import sys, glob, getopt +import getopt sys.path.insert(0, glob.glob('./lib')[0]) @@ -27,18 +28,13 @@ from thrift.protocol import TBinaryProtocol #Load configuration parameters from domino_conf import * -def main(argv): -# try: -# if argv[0] == 'heartbeat': -# print 'Heartbeat input' -# except IndexError as ex: -# print 'Insufficient number of arguments entered' -# except: -# print('Error: %s', sys.exc_info()[0]) +def main(argv, cli_port): + #cli_port = DOMINO_CLI_PORT try: # Make socket - transport = TSocket.TSocket('localhost', DOMINO_CLI_PORT) + # NOTE that domino-cli.py and DominoClient.py are assumed to be run in the same machine + transport = TSocket.TSocket('localhost', cli_port) # Buffering is critical. Raw sockets are very slow transport = TTransport.TBufferedTransport(transport) # Wrap in a protocol @@ -58,4 +54,8 @@ def main(argv): print '%s' % (tx.message) if __name__ == "__main__": - main(sys.argv[1:]) + if len(sys.argv) >= 2: + main(sys.argv[2:], sys.argv[1]) + else: + print 'domino-cli.py <cliport> ...' + sys.exit(2) |