diff options
author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-01 11:55:00 +0200 |
---|---|---|
committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-04 20:58:06 +0200 |
commit | 208414293f341923990ff3a30f1d0eddbf94b14f (patch) | |
tree | 851108135f5895ef4fe85d9906893bbb571c5324 /python/vyos | |
parent | 66ecfc6ecada4e50562dcfa4635b83daa5b0b1ff (diff) | |
download | vyos-1x-208414293f341923990ff3a30f1d0eddbf94b14f.tar.gz vyos-1x-208414293f341923990ff3a30f1d0eddbf94b14f.zip |
vlan: T2241: cleanup vlan_to_dict function
Remove one unnecessary call to conf.get_level()
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/configdict.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index e1b704a31..943092ceb 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -416,13 +416,13 @@ def add_to_dict(conf, disabled, ifdict, section, key): def vlan_to_dict(conf, default=vlan_default): vlan, disabled = intf_to_dict(conf, default) - # get the '100' in 'interfaces bonding bond0 vif-s 100 - vlan['id'] = conf.get_level()[-1] - current_level = conf.get_level() + level = conf.get_level() + # get the '100' in 'interfaces bonding bond0 vif-s 100' + vlan['id'] = level[-1] # if this is a not within vif-s node, we are done - if current_level[-2] != 'vif-s': + if level[-2] != 'vif-s': return vlan # ethertype is mandatory on vif-s nodes and only exists here! |