From: Sapan Bhatia Date: Mon, 26 Oct 2009 15:32:46 +0000 (+0000) Subject: Returning the request context in the right format. This is needed by sfatables. X-Git-Tag: sfa-0.9-6~116 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c5e4e0489a8dd58866cfbec8391a31c20328b33c;p=sfa.git Returning the request context in the right format. This is needed by sfatables. --- diff --git a/sfa/rspecs/aggregates/rspec_manager_openflow.py b/sfa/rspecs/aggregates/rspec_manager_openflow.py index 314f21a2..adc56799 100755 --- a/sfa/rspecs/aggregates/rspec_manager_openflow.py +++ b/sfa/rspecs/aggregates/rspec_manager_openflow.py @@ -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() diff --git a/sfa/rspecs/aggregates/rspec_manager_pl.py b/sfa/rspecs/aggregates/rspec_manager_pl.py index 51fb1295..ffc0a2b4 100644 --- a/sfa/rspecs/aggregates/rspec_manager_pl.py +++ b/sfa/rspecs/aggregates/rspec_manager_pl.py @@ -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 diff --git a/sfa/rspecs/aggregates/rspec_manager_vini.py b/sfa/rspecs/aggregates/rspec_manager_vini.py index f6a21c55..a8370ff3 100644 --- a/sfa/rspecs/aggregates/rspec_manager_vini.py +++ b/sfa/rspecs/aggregates/rspec_manager_vini.py @@ -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()