summaryrefslogtreecommitdiff
path: root/src/op_mode/powerctrl.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-06-06 19:23:10 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-06-06 22:23:09 -0500
commitef3a9babe6e07d93773d71d00e8f4849876938ed (patch)
tree301b1cf1b1fe1a55ade664669685785e940fb5f2 /src/op_mode/powerctrl.py
parent83c8bcd9ddd875d7f7c6d101c67fe3eb35d76629 (diff)
downloadvyos-1x-ef3a9babe6e07d93773d71d00e8f4849876938ed.tar.gz
vyos-1x-ef3a9babe6e07d93773d71d00e8f4849876938ed.zip
op-mode: T5262: use module function instead of method
Diffstat (limited to 'src/op_mode/powerctrl.py')
-rwxr-xr-xsrc/op_mode/powerctrl.py5
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: