move auth and hierarchy into sfa/trust
[sfa.git] / sfa / util / policy.py
1 ### $Id$
2 ### $URL$
3
4 import os
5
6 from sfa.util.storage import *
7 from sfa.util.debug import log
8
9 class Policy(SimpleStorage):
10
11     def __init__(self, api):
12         self.api = api
13         path = self.api.config.basepath
14         filename = ".".join([self.api.interface, self.api.hrn, "policy"])    
15         filepath = path + os.sep + filename
16         self.policy_file = filepath
17         default_policy = {'slice_whitelist': [],
18                           'slice_blacklist': [],
19                           'node_whitelist': [],
20                           'node_blacklist': []} 
21         SimpleStorage.__init__(self, self.policy_file, default_policy)
22         self.load()          
23