diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-08-01 10:56:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 10:56:40 +0200 |
commit | 537fc205933b99d291a4e696cee392785ca964bc (patch) | |
tree | 52ee3d4dbb80563aae85f1450a76bf0fc94eb2ee /src/op_mode/vrf.py | |
parent | 225b1d3ef2e211c03814cb823b857c66084f7978 (diff) | |
parent | ab84f1f3757bb82c3ddf95143c014cdb3d997977 (diff) | |
download | vyos-1x-537fc205933b99d291a4e696cee392785ca964bc.tar.gz vyos-1x-537fc205933b99d291a4e696cee392785ca964bc.zip |
Merge pull request #1451 from sever-sever/T4562
vrf: T4562: Check VRF if it has not been configured
Diffstat (limited to 'src/op_mode/vrf.py')
-rwxr-xr-x | src/op_mode/vrf.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/op_mode/vrf.py b/src/op_mode/vrf.py index f86516786..e3d944d90 100755 --- a/src/op_mode/vrf.py +++ b/src/op_mode/vrf.py @@ -15,6 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import json +import jmespath import sys import typing @@ -76,6 +77,8 @@ def _get_formatted_output(raw_data): def show(raw: bool, name: typing.Optional[str]): vrf_data = _get_raw_data(name=name) + if not jmespath.search('[*].ifname', vrf_data): + return "VRF is not configured" if raw: return vrf_data else: |