Removed custom timeslot and duration to make a reservation on OAR.
[sfa.git] / sfa / rspecs / versions / slabv1.py
index 035f7d9..bba4484 100644 (file)
@@ -30,11 +30,12 @@ class Slabv1(RSpecVersion):
     
     # Network 
     def get_networks(self):
+        #WARNING Added //default:network to the xpath 
+        #otherwise network element not detected 16/07/12 SA
+        
         network_elems = self.xml.xpath('//network | //default:network') 
-        logger.debug(" slabv1 \tget_networks network_elems %s  "%(network_elems) )
         networks = [network_elem.get_instance(fields=['name', 'slice']) for \
                     network_elem in network_elems]
-        logger.debug(" slabv1 \tget_networks  %s"%(networks))
         return networks    
 
 
@@ -57,9 +58,12 @@ class Slabv1(RSpecVersion):
     
     def get_slice_timeslot(self ):
         return Slabv1Timeslot.get_slice_timeslot(self.xml)
-
+    
+    def add_connection_information(self, ldap_username):
+        return Slabv1Node.add_connection_information(self.xml,ldap_username)
+    
     def add_nodes(self, nodes, check_for_dupes=False):
-        return Slabv1Node.add_nodes(self.xml, nodes)
+        return Slabv1Node.add_nodes(self.xml,nodes )
     
     def merge_node(self, source_node_tag, network, no_dupes = False):
         logger.debug("SLABV1 merge_node")
@@ -93,18 +97,16 @@ class Slabv1(RSpecVersion):
     def get_slice_attributes(self, network=None):
         
         slice_attributes = []
-        slot = self.get_slice_timeslot()
+
         nodes_with_slivers = self.get_nodes_with_slivers()
-        slice_attributes.append({'timeslot':slot})
-        #slice_attributes.append({'name': 'timeslot', 'value' : slot})
-        print>>sys.stderr, "\r\n \r\n \r\n \t\t SLABV1.PY get_slice_attributes -----------------nodes_with_slivers %s "%(nodes_with_slivers)
+
         # TODO: default sliver attributes in the PG rspec?
         default_ns_prefix = self.namespaces['default']
         for node in nodes_with_slivers:
             sliver_attributes = self.get_sliver_attributes(node['component_id'],node, network)
             for sliver_attribute in sliver_attributes:
-                name=str(sliver_attribute[0])
-                text =str(sliver_attribute[1])
+                name = str(sliver_attribute[0])
+                text = str(sliver_attribute[1])
                 attribs = sliver_attribute[2]
                 # we currently only suppor the <initscript> and <flack> attributes
                 #if  'info' in name:
@@ -119,8 +121,7 @@ class Slabv1(RSpecVersion):
                     attribute = {'name': 'initscript', 'value': value, 'node_id': node}
                     slice_attributes.append(attribute)
           
-                    
-        print>>sys.stderr, "\r\n \r\n \r\n \t\t SLABV1.PY get_slice_attributes ----------------- slice_attributes %s "%(slice_attributes)
+
         return slice_attributes
 
     def attributes_list(self, elem):
@@ -218,13 +219,10 @@ class Slabv1(RSpecVersion):
             from sfa.rspecs.rspec_converter import RSpecConverter
             in_rspec = RSpecConverter.to_sfa_rspec(rspec.toxml())
             rspec = RSpec(in_rspec)
-        logger.debug(" SLABV1 \tmerge rspec %s " %(rspec.toxml()) )
         # just copy over all networks
         #Attention special get_networks using //default:network xpath
         current_networks = self.get_networks() 
-        logger.debug(" SLABV1\tmerge rspec version %s" %(rspec.version))
         networks = rspec.version.get_networks()
-        logger.debug("SLABV1 \tmerge current_networks %s networks  %s " %(current_networks, networks) ) 
         for network in networks:
             current_network = network.get('name')
             if current_network and current_network not in current_networks: