diff options
| author | Daniil Baturin <daniil@baturin.org> | 2025-12-04 13:52:31 +0000 |
|---|---|---|
| committer | Daniil Baturin <daniil@baturin.org> | 2025-12-04 13:55:31 +0000 |
| commit | 8653844687467bd11ce73e6cada8a939db5c0436 (patch) | |
| tree | fcf3fd7af4db146c0aff9dd76a97cabeaefe41bb /src | |
| parent | a6ab36aab78a0f5f9b1d3f58185b1f71cee41b3d (diff) | |
| download | vyos-1x-8653844687467bd11ce73e6cada8a939db5c0436.tar.gz vyos-1x-8653844687467bd11ce73e6cada8a939db5c0436.zip | |
op-mode: T7810: fix broken 'reset connection' command
Diffstat (limited to 'src')
| -rwxr-xr-x | src/op_mode/connect_disconnect.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/op_mode/connect_disconnect.py b/src/op_mode/connect_disconnect.py index 117e65713..d5db85d25 100755 --- a/src/op_mode/connect_disconnect.py +++ b/src/op_mode/connect_disconnect.py @@ -98,19 +98,23 @@ def main(): group = parser.add_mutually_exclusive_group() group.add_argument("--connect", help="Bring up a connection-oriented network interface", action="store_true") group.add_argument("--disconnect", help="Take down connection-oriented network interface", action="store_true") + group.add_argument("--reconnect", help="Reconnect connection-oriented network interface", action="store_true") parser.add_argument("--interface", help="Interface name", action="store", required=True) args = parser.parse_args() - if args.connect or args.disconnect: - if args.disconnect: - disconnect(args.interface) - - if args.connect: - if commit_in_progress(): - print('Cannot connect while a commit is in progress') - exit(1) - connect(args.interface) - + # Disallow connecting interfaces while their configuration might be changing + if args.connect or args.reconnect: + if commit_in_progress(): + print('Cannot connect while a commit is in progress') + exit(1) + + if args.connect: + connect(args.interface) + elif args.disconnect: + disconnect(args.interface) + elif args.reconnect: + disconnect(args.interface) + connect(args.interface) else: parser.print_help() |
