diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-10-30 09:10:45 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-10-30 09:10:58 +0100 |
commit | a1327d2b970d4ca387a42d0e931d412cf1a5a102 (patch) | |
tree | 1757a1013482e5e493b7dd45e845189dca7c2ad1 /src/conf_mode | |
parent | f8c99aebd0e210cd70058cf07bf9fb8e2691c709 (diff) | |
download | vyos-1x-a1327d2b970d4ca387a42d0e931d412cf1a5a102.tar.gz vyos-1x-a1327d2b970d4ca387a42d0e931d412cf1a5a102.zip |
ssh: T2635: reuse common verify_vrf() function
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/ssh.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/conf_mode/ssh.py b/src/conf_mode/ssh.py index a19fa72d8..8d8e9e4c4 100755 --- a/src/conf_mode/ssh.py +++ b/src/conf_mode/ssh.py @@ -21,10 +21,11 @@ from sys import exit from vyos.config import Config from vyos.configdict import dict_merge -from vyos import ConfigError +from vyos.configverify import verify_vrf from vyos.util import call from vyos.template import render from vyos.xml import defaults +from vyos import ConfigError from vyos import airbag airbag.enable() @@ -54,9 +55,7 @@ def verify(ssh): if not ssh: return None - if 'vrf' in ssh.keys() and ssh['vrf'] not in interfaces(): - raise ConfigError('VRF "{vrf}" does not exist'.format(**ssh)) - + verify_vrf(ssh) return None def generate(ssh): |