CORD-2754 Add restart command line option
Change-Id: I1c88e71a44d1f2777c550fcfeb32afd6e365321a
diff --git a/main.py b/main.py
index a06e15d..2d06e53 100755
--- a/main.py
+++ b/main.py
@@ -197,6 +197,12 @@
default=defs['cert'],
help=_help)
+ _help = ('Restart chameleon if the gRPC connection is disconnected.')
+ parser.add_argument('-r', '--restart',
+ dest='restart',
+ action='store_true',
+ default=False,
+ help=_help)
args = parser.parse_args()
@@ -264,7 +270,7 @@
self.log.info('starting-internal-components')
args = self.args
self.grpc_client = yield \
- GrpcClient(args.consul, args.work_dir, args.grpc_endpoint)
+ GrpcClient(args.consul, args.work_dir, args.grpc_endpoint, restart_on_disconnect=args.restart)
if args.enable_tls == "False":
self.log.info('tls-disabled-through-configuration')