mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
25 lines
577 B
Python
25 lines
577 B
Python
#!/usr/bin/env python3
|
|
#
|
|
# Copyright 2014-2017 Cumulus Networks, Inc. All rights reserved.
|
|
# Author: Roopa Prabhu, roopa@cumulusnetworks.com
|
|
#
|
|
|
|
|
|
class MSTPAttrsCache():
|
|
bridges = {}
|
|
|
|
@classmethod
|
|
def get(cls, bridgename, default=None):
|
|
if bridgename in MSTPAttrsCache.bridges:
|
|
return MSTPAttrsCache.bridges[bridgename]
|
|
else:
|
|
return default
|
|
|
|
@classmethod
|
|
def set(cls, bridgename, attrs):
|
|
MSTPAttrsCache.bridges[bridgename] = attrs
|
|
|
|
@classmethod
|
|
def invalidate(cls):
|
|
MSTPAttrsCache.bridges = {}
|