Changed Rspec --> RSpec throughout.
authorSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 26 Oct 2009 18:31:09 +0000 (18:31 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 26 Oct 2009 18:31:09 +0000 (18:31 +0000)
16 files changed:
INSTALL.txt
docs/pythondoc-registry.html
sfa/client/genidump.py
sfa/client/getNodes.py
sfa/client/sfi.py
sfa/plc/nodes.py
sfa/plc/slices.py
sfa/rspecs/aggregates/rspec_manager_max.py
sfa/rspecs/aggregates/rspec_manager_openflow.py
sfa/rspecs/aggregates/rspec_manager_vini.py
sfa/rspecs/aggregates/vini/rspec.py
sfa/rspecs/aggregates/vini/utils.py
sfa/util/rspec.py
sfa/util/specdict.py
sfatables/runtime.py
sfatables/xmlrule.py

index 93cf41c..08c38e2 100644 (file)
@@ -118,7 +118,7 @@ At this stage you should be able to run sfi command. Some sample outputs are:
 
  (e) # sfi.py resources
 <?xml version="1.0" ?>
-<Rspec duration="3600" start_time="1246736949"><networks><NetSpec duration="3600" name="plc" start_time="1246736950"><nodes><NodeSpec cpu_min="" cpu_pct="" cpu_share="" disk_max="" duration="" init_params="" name="pif.inria.fr" start_time="" type=""><net_if><IfSpec addr="138.96.250.224" init_params="" ip_spoof="" max_kbyte="" max_rate="" min_rate="" name="True" type="ipv4"/></net_if></NodeSpec></nodes></NetSpec></networks></Rspec>
+<RSpec duration="3600" start_time="1246736949"><networks><NetSpec duration="3600" name="plc" start_time="1246736950"><nodes><NodeSpec cpu_min="" cpu_pct="" cpu_share="" disk_max="" duration="" init_params="" name="pif.inria.fr" start_time="" type=""><net_if><IfSpec addr="138.96.250.224" init_params="" ip_spoof="" max_kbyte="" max_rate="" min_rate="" name="True" type="ipv4"/></net_if></NodeSpec></nodes></NetSpec></networks></RSpec>
 ------
 
 6) Federation configuration:
index ba1891e..5bc665e 100644 (file)
@@ -286,7 +286,7 @@ a ticket. There are two parts to this information: attributes and
 rspec.
 
 Attributes are non-resource items, such as keys and the initscript
-Rspec is a set of resource specifications</p>
+RSpec is a set of resource specifications</p>
 <dl>
 <dt><i>record</i></dt>
 <dd>
index 5ba11e4..2cca0cd 100644 (file)
@@ -13,7 +13,7 @@ from sfa.trust.credential import Credential
 
 from sfa.util.geniclient import GeniClient
 from sfa.util.record import GeniRecord
-from sfa.util.rspec import Rspec
+from sfa.util.rspec import RSpec
 
 def determine_sfa_filekind(fn):
     cert = Certificate(filename = fn)
index 4d34a43..b87fa40 100644 (file)
@@ -6,7 +6,7 @@ from optparse import OptionParser
 from pprint import pprint
 from types import StringTypes
 
-from sfa.util.rspec import Rspec
+from sfa.util.rspec import RSpec
 
 def create_parser():
     command = sys.argv[0]
@@ -57,10 +57,10 @@ def main():
     parser = create_parser(); 
     (options, args) = parser.parse_args()
     if not options.infile:
-        print "Rspec file not specified"
+        print "RSpec file not specified"
         return 
         
-    rspec = Rspec()
+    rspec = RSpec()
     try:
         rspec.parseFile(options.infile)
     except:
index 79efeec..b3dbf35 100755 (executable)
@@ -13,7 +13,7 @@ from sfa.trust.certificate import Keypair, Certificate
 from sfa.trust.credential import Credential
 from sfa.util.geniclient import GeniClient
 from sfa.util.record import *
-from sfa.util.rspec import Rspec
+from sfa.util.rspec import RSpec
 from sfa.util.xmlrpcprotocol import ServerException
 import sfa.util.xmlrpcprotocol as xmlrpcprotocol
 from sfa.util.config import Config
@@ -691,7 +691,7 @@ class Sfi:
     
     def display_rspec(self,rspec, format = 'rspec'):
         if format in ['dns']:
-            spec = Rspec()
+            spec = RSpec()
             spec.parseString(rspec)
             hostnames = []
             nodespecs = spec.getDictsByTagName('NodeSpec')
@@ -703,7 +703,7 @@ class Sfi:
                         hostnames.append(nodespec['name'])
             result = hostnames
         elif format in ['ip']:
-            spec = Rspec()
+            spec = RSpec()
             spec.parseString(rspec)
             ips = []
             ifspecs = spec.getDictsByTagName('IfSpec')
index 29668b7..3fb3e98 100644 (file)
@@ -49,7 +49,7 @@ class Nodes(SimpleStorage):
                 self.refresh_nodes_smgr()
 
     def refresh_nodes_aggregate(self):
-        rspec = Rspec()
+        rspec = RSpec()
         rspec.parseString(self.get_rspec())
         
         # filter nodes according to policy
@@ -109,7 +109,7 @@ class Nodes(SimpleStorage):
         aggregates = Aggregates(self.api)
         rspecs = {}
         networks = []
-        rspec = Rspec()
+        rspec = RSpec()
         credential = self.api.getCredential() 
         for aggregate in aggregates:
             try:
@@ -129,7 +129,7 @@ class Nodes(SimpleStorage):
                 print >> log, "%s" % (traceback.format_exc())
         # create the rspec dict
         resources = {'networks': networks, 'start_time': start_time, 'duration': duration}
-        resourceDict = {'Rspec': resources}
+        resourceDict = {'RSpec': resources}
         # convert rspec dict to xml
         rspec.parseDict(resourceDict)
         return rspec
@@ -257,9 +257,9 @@ class Nodes(SimpleStorage):
         resources = {'networks': networks, 'start_time': start_time, 'duration': duration}
 
         # convert the plc dict to an rspec dict
-        resourceDict = RspecDict(resources)
+        resourceDict = RSpecDict(resources)
         # convert the rspec dict to xml
-        rspec = Rspec()
+        rspec = RSpec()
         rspec.parseDict(resourceDict)
         return rspec.toxml()
         
index ca4d316..f059136 100644 (file)
@@ -345,7 +345,7 @@ class Slices(SimpleStorage):
         peer = self.get_peer(hrn)
         sfa_peer = self.get_sfa_peer(hrn)
 
-        spec = Rspec(rspec)
+        spec = RSpec(rspec)
         # Get the slice record from sfa
         slicename = hrn_to_pl_slicename(hrn) 
         slice = {}
@@ -385,12 +385,12 @@ class Slices(SimpleStorage):
         return 1
 
     def create_slice_smgr(self, hrn, rspec):
-        spec = Rspec()
-        tempspec = Rspec()
+        spec = RSpec()
+        tempspec = RSpec()
         spec.parseString(rspec)
         slicename = hrn_to_pl_slicename(hrn)
         specDict = spec.toDict()
-        if specDict.has_key('Rspec'): specDict = specDict['Rspec']
+        if specDict.has_key('RSpec'): specDict = specDict['RSpec']
         if specDict.has_key('start_time'): start_time = specDict['start_time']
         else: start_time = 0
         if specDict.has_key('end_time'): end_time = specDict['end_time']
@@ -405,7 +405,7 @@ class Slices(SimpleStorage):
         for netspec in netspecs:
             net_hrn = netspec['name']
             resources = {'start_time': start_time, 'end_time': end_time, 'networks': netspec}
-            resourceDict = {'Rspec': resources}
+            resourceDict = {'RSpec': resources}
             tempspec.parseDict(resourceDict)
             rspecs[net_hrn] = tempspec.toxml()
 
index 2de9181..e4ff71a 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-from sfa.util.rspec import Rspec
+from sfa.util.rspec import RSpec
 import sys
 import pdb
 from sfa.util.misc import *
@@ -27,7 +27,7 @@ class GeniOutOfResource(GeniFault):
         faultString = "Interface " + interface + " not available"
         GeniFault.__init__(self, 100, faultString, '')
 
-class GeniNoPairRspec(GeniFault):
+class GeniNoPairRSpec(GeniFault):
     def __init__(self, interface, interface2):
         faultString = "Interface " + interface + " should be paired with " + interface2
         GeniFault.__init__(self, 100, faultString, '')
@@ -36,7 +36,7 @@ class GeniNoPairRspec(GeniFault):
 # i -> node,i_peer
 
 def get_interface_map():
-    r = Rspec()
+    r = RSpec()
     r.parseFile(SFA_MAX_DEFAULT_RSPEC)
     rspec = r.toDict()
     capacity = rspec['rspec']['capacity']
@@ -267,7 +267,7 @@ def create_slice(api, hrn, rspec_xml):
 
     # Check if everything in rspec is either allocated by hrn
     # or not allocated at all.
-    r = Rspec()
+    r = RSpec()
     r.parseString(rspec_xml)
     rspec = r.toDict()
 
@@ -290,7 +290,7 @@ def create_slice(api, hrn, rspec_xml):
         if (a not in current_hrn_interfaces and a in current_interfaces):
             raise GeniOutOfResource(a)
         if (topology[a][1] not in requested_interfaces):
-            raise GeniNoPairRspec(a,topology[a][1])
+            raise GeniNoPairRSpec(a,topology[a][1])
     # Request OK
 
     # Allocations to delete
@@ -316,13 +316,13 @@ def rspec_to_allocations(rspec):
         for l in ifspecs:
             ifs.extend([(l['name'].replace('tns:',''),l['ip'])])
     except KeyError:
-        # Bad Rspec
+        # Bad RSpec
         pass
     return ifs
 
 def main():
     t = get_interface_map()
-    r = Rspec()
+    r = RSpec()
     rspec_xml = open(sys.argv[1]).read()
     #get_rspec(None,'foo')
     create_slice(None, "plc.princeton.sap0", rspec_xml)
index adc5679..df1cf78 100755 (executable)
@@ -1,6 +1,6 @@
 from sfa.util.faults import *
 from sfa.util.misc import *
-from sfa.util.rspec import Rspec
+from sfa.util.rspec import RSpec
 from sfa.server.registry import Registries
 from sfa.util.config import Config
 from sfa.plc.nodes import *
@@ -157,7 +157,7 @@ def fetch_context(slice_hrn, user_hrn, contexts):
     return base_context
 
 def main():
-    r = Rspec()
+    r = RSpec()
     r.parseFile(sys.argv[1])
     rspec = r.toDict()
     create_slice(None,'plc',rspec)
index a8370ff..2875a40 100644 (file)
@@ -1,6 +1,6 @@
 from sfa.util.faults import *
 from sfa.util.misc import *
-from sfa.util.rspec import Rspec
+from sfa.util.rspec import RSpec
 from sfa.server.registry import Registries
 from sfa.plc.nodes import *
 from sfa.rspecs.aggregates.vini.utils import *
@@ -166,10 +166,10 @@ def create_slice(api, hrn, xml):
     else:
         raise PermissionError("%s not in VINI whitelist" % hrn)
         
-    rspec = Rspec(xml)
+    rspec = RSpec(xml)
     topo = Topology(api)
     
-    topo.nodeTopoFromRspec(rspec)
+    topo.nodeTopoFromRSpec(rspec)
 
     # Check request against current allocations
     topo.verifyNodeTopo(hrn, topo, maxbw)
@@ -197,7 +197,7 @@ def fetch_context(slice_hrn, user_hrn, contexts):
     return base_context
 
 def main():
-    r = Rspec()
+    r = RSpec()
     r.parseFile(sys.argv[1])
     rspec = r.toDict()
     create_slice(None,'plc',rspec)
index 12b7b44..fb08c1a 100644 (file)
@@ -1,12 +1,12 @@
-from sfa.util.rspec import Rspec
+from sfa.util.rspec import RSpec
 from sfa.rspecs.aggregates.vini.utils import *
 import sys
 
 SFA_VINI_DEFAULT_RSPEC = '/etc/sfa/vini.rspec'
 
-class ViniRspec(Rspec):
+class ViniRSpec(RSpec):
     def __init__(self, xml = None, xsd = None, NSURL = None):
-        Rspec.__init__(self, xml, xsd, NSURL)
+        RSpec.__init__(self, xml, xsd, NSURL)
         if not xml:
             self.parseFile(SFA_VINI_DEFAULT_RSPEC)
         
index 4d74f16..c311887 100644 (file)
@@ -481,7 +481,7 @@ class Topology:
                 return link
         return None
     
-    def nodeTopoFromRspec(self, rspec):
+    def nodeTopoFromRSpec(self, rspec):
         if self.nodelinks:
             raise Error("virtual topology already present")
             
index 903365c..fab1b57 100644 (file)
@@ -8,7 +8,7 @@ import httplib
 from xml.dom import minidom
 from types import StringTypes, ListType
 
-class Rspec:
+class RSpec:
 
     def __init__(self, xml = None, xsd = None, NSURL = None):
         '''
@@ -363,7 +363,7 @@ class Rspec:
     
 
 
-class RecordSpec(Rspec):
+class RecordSpec(RSpec):
 
     root_tag = 'record'
     def parseDict(self, rdict, include_doc = False):
@@ -376,7 +376,7 @@ class RecordSpec(Rspec):
         record_dict = rdict
         if not len(rdict.keys()) == 1:
             record_dict = {self.root_tag : rdict}
-        return Rspec.dict2dom(self, record_dict, include_doc)
+        return RSpec.dict2dom(self, record_dict, include_doc)
 
         
 # vim:ts=4:expandtab
index 5960887..7a6ff97 100644 (file)
@@ -120,7 +120,7 @@ class NetSpecDict(SpecDict):
                   'nodes': 'nodes',
                   'links': 'links'}
 
-class RspecDict(SpecDict):
+class RSpecDict(SpecDict):
     type = 'RSpec'
     fields = {'start_time': '',
               'duration': '',
index 0ed38e0..b76ec0a 100644 (file)
@@ -55,7 +55,7 @@ class SFATablesRules:
                 
     def add_request_context_to_rspec(self, doc):
         p = doc.xpathNewContext()
-        context = p.xpathEval("//Rspec")
+        context = p.xpathEval("//RSpec")
         if (not context):
             raise Exception('Request is not an rspec')
         else:
index 97940de..1a31711 100644 (file)
@@ -57,7 +57,7 @@ class XMLRule:
 
     def add_rule_context_to_rspec(self, doc):
         p = doc.xpathNewContext()
-        context = p.xpathEval("//Rspec")
+        context = p.xpathEval("//RSpec")
         if (not context):
             raise Exception('Request is not an rspec')
         else: