Returning the request context in the right format. This is needed by sfatables.
authorSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 26 Oct 2009 15:32:46 +0000 (15:32 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 26 Oct 2009 15:32:46 +0000 (15:32 +0000)
sfa/rspecs/aggregates/rspec_manager_openflow.py
sfa/rspecs/aggregates/rspec_manager_pl.py
sfa/rspecs/aggregates/rspec_manager_vini.py

index 314f21a..adc5679 100755 (executable)
@@ -147,8 +147,14 @@ def get_rspec(cred, hrn=None):
         print "IO error"
     return None
 
+"""
+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):
-    return None
+    base_context = {'sfa':{'user':{'hrn':user_hrn}}}
+    return base_context
 
 def main():
     r = Rspec()
index 51fb129..ffc0a2b 100644 (file)
@@ -1,5 +1,8 @@
-# Nothing here for now.
-
+"""
+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}}}
     return base_context
index f6a21c5..a8370ff 100644 (file)
@@ -187,15 +187,20 @@ def create_slice(api, hrn, xml):
 
     return True
 
+"""
+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}}}
+    return base_context
 
 def main():
     r = Rspec()
     r.parseFile(sys.argv[1])
     rspec = r.toDict()
     create_slice(None,'plc',rspec)
-    
-def fetch_context(slice_hrn, user_hrn, contexts):
-    return None
 
 if __name__ == "__main__":
     main()