Page MenuHomeVyOS Platform

T9518-json.py

Authored By
rherold
Wed, Oct 28, 9:51 AM
Size
370 B
Referenced Files
None
Subscribers
None

T9518-json.py

import json
p = '/usr/share/vyos/config-mode-dependencies/vyos-vpp.json'
d = json.load(open(p))
d['vpp']['mpls'] = ['protocols_mpls']
d.setdefault('interfaces_ethernet', {})['mpls'] = ['protocols_mpls']
json.dump(d, open(p, 'w'), indent=4)
open(p, 'a').write('\n')
print(d['vpp']['mpls'] == ['protocols_mpls'] and d['interfaces_ethernet']['mpls'] == ['protocols_mpls'])

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4565588
Default Alt Text
T9518-json.py (370 B)

Event Timeline