Page MenuHomeVyOS Platform

Function commit_in_progress works incorrect
Closed, InvalidPublicBUG

Description

Function commit_in_progress works incorrect

Simple test:

vyos@r14:~$ cat test.py 
#!/usr/bin/env python3

from vyos.util import commit_in_progress


if commit_in_progress:
    print('COMMIT IN PROGRESS')
else:
    print('NO COMMITS')
vyos@r14:~$ 
vyos@r14:~$ 
vyos@r14:~$ 
vyos@r14:~$ sudo ./test.py
COMMIT IN PROGRESS
vyos@r14:~$

But there is no commit:

vyos@r14:~$ ps ax | grep commit | egrep -v grep
vyos@r14:~$

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.4-rolling-202206260217
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Bug of testing
I tested commit_in_progress instead of commit_in_progress()

Yes, I spent quite some time trying to replicate your findings until I noticed that you used if commit_in_progress, so the truth value of a defined object that isn't None or False was trivially true.

But at least now we know for sure that it's working correctly in most, if not all circumstances. ;)