diff options
| author | John Estabrook <jestabro@vyos.io> | 2023-06-07 09:19:01 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-07 09:19:01 -0500 | 
| commit | bcbce9265b43745a9da76d7cff685c0f01a5098e (patch) | |
| tree | 301b1cf1b1fe1a55ade664669685785e940fb5f2 /src/op_mode/powerctrl.py | |
| parent | 4d029a3d0b23a8b11ffd18da9cb4e9c543e70d06 (diff) | |
| parent | ef3a9babe6e07d93773d71d00e8f4849876938ed (diff) | |
| download | vyos-1x-bcbce9265b43745a9da76d7cff685c0f01a5098e.tar.gz vyos-1x-bcbce9265b43745a9da76d7cff685c0f01a5098e.zip | |
Merge pull request #2031 from jestabro/unsaved-commits
op-mode: T5262: move 'unsaved_commits' to module scope and correct false positive
Diffstat (limited to 'src/op_mode/powerctrl.py')
| -rwxr-xr-x | src/op_mode/powerctrl.py | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py index b517527bb..239f766fd 100755 --- a/src/op_mode/powerctrl.py +++ b/src/op_mode/powerctrl.py @@ -103,10 +103,9 @@ def cancel_shutdown():          print("Reboot or poweroff is not scheduled")  def check_unsaved_config(): -    from vyos.config_mgmt import ConfigMgmt +    from vyos.config_mgmt import unsaved_commits -    c = ConfigMgmt() -    if c._unsaved_commits(): +    if unsaved_commits():          print("Warning: there are unsaved configuration changes!")          print("Run 'save' command if you do not want to lose those changes after reboot/shutdown.")      else: | 
