Page MenuHomeVyOS Platform

Consistent use of unconfigured entity errors in op mode
Open, LowPublic

Description

Right now, our op mode doesn't consistently notify the user if things they are trying to get some info about or do something with don't exist in the system at all.

For example, if you try to look up a non-existent interface, you just get empty data.

vyos@vyos# sudo /usr/libexec/vyos/op_mode/interfaces.py show --raw --intf-name eth999
[]

Likewise, if you try to reset an IPsec peer when IPsec is not running at all, you always get "IPsec is not initialized" — but why isn't it, because the daemon is dead or because there's no IPsec?

vyos@vyos# sudo /usr/libexec/vyos/op_mode/interfaces.py show --raw --intf-name eth999
[]

I suppose that if something doesn't exist in the system, it should always return an error to let the user know that the data will not appear by itself and help them catch errors in API clients.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Improvement (missing useful functionality)