From 208414293f341923990ff3a30f1d0eddbf94b14f Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Fri, 1 May 2020 11:55:00 +0200 Subject: vlan: T2241: cleanup vlan_to_dict function Remove one unnecessary call to conf.get_level() --- python/vyos/configdict.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'python/vyos') 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! -- cgit v1.2.3