-def rspec_to_nodeset(rspec):
- nodedict = {}
- nodes = set()
- try:
- sitespecs = rspec['Rspec'][0]['Capacity'][0]['NetSpec'][0]['SiteSpec']
- for s in sitespecs:
- for node in s['NodeSpec']:
- nodedict[node['name'][0]] = node['hostname'][0]
-
- linkspecs = rspec['Rspec'][0]['Request'][0]['NetSpec'][0]['LinkSpec']
- for l in linkspecs:
- for e in l['endpoint']:
- nodes.add(nodedict[e])
-
- except KeyError:
- # Bad Rspec
- pass
-
- return nodes
+"""
+Returns the request context required by sfatables. At some point, this mechanism should be changed
+to refer to "contexts", which is the information that sfatables is requesting. But for now, we just
+return the basic information needed in a dict.
+"""
+def fetch_context(slice_hrn, user_hrn, contexts):
+ base_context = {'sfa':{'user':{'hrn':user_hrn},
+ 'slice':{'hrn':slice_hrn}}}
+ return base_context