From 28ba0ef32425ee458293a37a4a5ba664dfe577b2 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 6 Jul 2022 15:32:42 +0000 Subject: op-mode: T4503: Prevent restart service if commit in progress Prevent op-mode scripts from restarting services if commit in progress --- src/op_mode/connect_disconnect.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/op_mode/connect_disconnect.py') diff --git a/src/op_mode/connect_disconnect.py b/src/op_mode/connect_disconnect.py index ffc574362..936c20bcb 100755 --- a/src/op_mode/connect_disconnect.py +++ b/src/op_mode/connect_disconnect.py @@ -20,6 +20,7 @@ import argparse from psutil import process_iter from vyos.util import call +from vyos.util import commit_in_progress from vyos.util import DEVNULL from vyos.util import is_wwan_connected @@ -87,6 +88,9 @@ def main(): args = parser.parse_args() if args.connect: + if commit_in_progress(): + print('Cannot connect while a commit is in progress') + exit(1) connect(args.connect) elif args.disconnect: disconnect(args.disconnect) -- cgit v1.2.3