2014-10-09 16:02:46 -07:00
|
|
|
#!/usr/bin/python
|
|
|
|
#
|
2018-12-13 11:43:32 -08:00
|
|
|
# Copyright 2014-2017 Cumulus Networks, Inc. All rights reserved.
|
2014-10-09 16:02:46 -07:00
|
|
|
# Author: Roopa Prabhu, roopa@cumulusnetworks.com
|
|
|
|
#
|
|
|
|
|
2016-04-29 21:21:45 +02:00
|
|
|
|
|
|
|
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 = {}
|