]> git.proxmox.com Git - mirror_ifupdown2.git/blob - ifupdown2/ifupdownaddons/cache.py
addons: address: fix merge-indentation issue
[mirror_ifupdown2.git] / ifupdown2 / ifupdownaddons / cache.py
1 #!/usr/bin/env python3
2 #
3 # Copyright 2014-2017 Cumulus Networks, Inc. All rights reserved.
4 # Author: Roopa Prabhu, roopa@cumulusnetworks.com
5 #
6
7
8 class MSTPAttrsCache():
9 bridges = {}
10
11 @classmethod
12 def get(cls, bridgename, default=None):
13 if bridgename in MSTPAttrsCache.bridges:
14 return MSTPAttrsCache.bridges[bridgename]
15 else:
16 return default
17
18 @classmethod
19 def set(cls, bridgename, attrs):
20 MSTPAttrsCache.bridges[bridgename] = attrs
21
22 @classmethod
23 def invalidate(cls):
24 MSTPAttrsCache.bridges = {}