diff options
author | Daniil Baturin <daniil@vyos.io> | 2022-07-18 12:13:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 12:13:26 +0100 |
commit | 91efb252a73af6f8531a196bda147dca3b0978eb (patch) | |
tree | 14b81b1498767a72dbd57d673583391154345fd1 /python/vyos/validate.py | |
parent | 0665732aa91707dcdeff9b94b08fe7fd3f3291b7 (diff) | |
parent | 6f53eb48d5c9d79354d4349c042eec02b8051560 (diff) | |
download | vyos-1x-91efb252a73af6f8531a196bda147dca3b0978eb.tar.gz vyos-1x-91efb252a73af6f8531a196bda147dca3b0978eb.zip |
Merge pull request #1406 from c-po/equuleus-interface-fixes
equuleus: Bond and Bridge interface fixes + new smoketests
Diffstat (limited to 'python/vyos/validate.py')
-rw-r--r-- | python/vyos/validate.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py index 23e88b5ac..9aa23d3dc 100644 --- a/python/vyos/validate.py +++ b/python/vyos/validate.py @@ -260,3 +260,22 @@ def has_address_configured(conf, intf): conf.set_level(old_level) return ret + +def has_vrf_configured(conf, intf): + """ + Checks if interface has a VRF configured. + + Returns True if interface has VRF configured, False if it doesn't. + """ + from vyos.ifconfig import Section + ret = False + + old_level = conf.get_level() + conf.set_level([]) + + tmp = ['interfaces', Section.get_config_path(intf), 'vrf'] + if conf.exists(tmp): + ret = True + + conf.set_level(old_level) + return ret |