Skip to content
Snippets Groups Projects
Commit b8e0bbd1 authored by Karim Ahmed's avatar Karim Ahmed
Browse files

CLI manual_run input

parent 98573b89
No related branches found
No related tags found
Loading
...@@ -9,13 +9,13 @@ import zmq ...@@ -9,13 +9,13 @@ import zmq
import zmq.asyncio import zmq.asyncio
def manual_run(req_conf): def manual_run(req_instr):
""" """
Run the report service manually from any machine Run the report service manually from any machine
and provide the requested configuration for and provide the requested configuration for
reports generation. reports generation.
:param req_conf: a list for generating reports for the :param req_instr: a list for generating reports for the
requested Instruments. This list can requested Instruments. This list can
contain the Instruments names e.g ['SPB'] contain the Instruments names e.g ['SPB']
or ['all'] for generating reports for all or ['all'] for generating reports for all
...@@ -32,11 +32,12 @@ def manual_run(req_conf): ...@@ -32,11 +32,12 @@ def manual_run(req_conf):
con = zmq.Context() con = zmq.Context()
socket = con.socket(zmq.REQ) socket = con.socket(zmq.REQ)
con = socket.connect(port) con = socket.connect(port)
socket.send_pyobj(req_conf) socket.send_pyobj(req_instr)
msg = socket.recv_pyobj() msg = socket.recv_pyobj()
logging.info('{} Manual Run'.format(msg)) logging.info('{} Manual Run'.format(msg))
arg_parser = argparse.ArgumentParser(description='Manual Launch') arg_parser = argparse.ArgumentParser(description='Manual Launch')
arg_parser.add_argument('--req-instr', default='all', nargs='+')
arg_parser.add_argument('--config-file', type=str, default='./report_conf.yaml') arg_parser.add_argument('--config-file', type=str, default='./report_conf.yaml')
arg_parser.add_argument('--log-file', type=str, default='./report.log') arg_parser.add_argument('--log-file', type=str, default='./report.log')
arg_parser.add_argument('--logging', type=str, default="INFO", arg_parser.add_argument('--logging', type=str, default="INFO",
...@@ -56,4 +57,4 @@ if __name__ == "__main__": ...@@ -56,4 +57,4 @@ if __name__ == "__main__":
format='%(levelname)-6s: %(asctime)s %(message)s', format='%(levelname)-6s: %(asctime)s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S') datefmt='%Y-%m-%d %H:%M:%S')
manual_run(['all']) manual_run(args["req_instr"])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment