diff options
Diffstat (limited to 'src/op_mode/clear_dhcp_lease.py')
-rwxr-xr-x | src/op_mode/clear_dhcp_lease.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/op_mode/clear_dhcp_lease.py b/src/op_mode/clear_dhcp_lease.py index 6ac3d4c1c..250dbcce1 100755 --- a/src/op_mode/clear_dhcp_lease.py +++ b/src/op_mode/clear_dhcp_lease.py @@ -9,6 +9,7 @@ from isc_dhcp_leases import IscDhcpLeases from vyos.configquery import ConfigTreeQuery from vyos.util import ask_yes_no from vyos.util import call +from vyos.util import commit_in_progress config = ConfigTreeQuery() @@ -66,6 +67,10 @@ if __name__ == '__main__': if not is_ip_in_leases(address): exit(1) + if commit_in_progress(): + print('Cannot clear DHCP lease while a commit is in progress') + exit(1) + if not ask_yes_no(f'This will restart DHCP server.\nContinue?'): exit(1) else: |