Skip to content

Commit

Permalink
[config engine] For l2 preset, use admin_status: up by default (#3902)
Browse files Browse the repository at this point in the history
Updated the l2 preset config generator to specify 'admin_status': 'up' for every port by default.
The use of setdefault() ensures that if port already has some admin_status set, the original value will not be overwritten.

Signed-off-by: Mykola Faryma <[email protected]>
  • Loading branch information
mykolaf authored and lguohan committed Dec 13, 2019
1 parent 86e23f9 commit fbcaaa4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sonic-config-engine/config_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def generate_l2_config(data):
data['VLAN']['Vlan1000'].setdefault('members', vp)
data['VLAN_MEMBER'] = {}
for port in natsorted(data['PORT'].keys()):
data['PORT'][port].setdefault('admin_status', 'up')
data['VLAN_MEMBER']['Vlan1000|{}'.format(port)] = {'tagging_mode': 'untagged'}
return data

Expand Down

0 comments on commit fbcaaa4

Please sign in to comment.