interface elements in the manifest rspec should contain a sliver id attribute
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Fri, 31 Aug 2012 00:50:48 +0000 (20:50 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Fri, 31 Aug 2012 00:50:48 +0000 (20:50 -0400)
sfa/openstack/osaggregate.py
sfa/rspecs/elements/versions/pgv2Interface.py

index fd4c750..09d9f46 100644 (file)
@@ -166,8 +166,10 @@ class OSAggregate:
             if_xrn = PlXrn(auth=self.driver.hrn, 
                            interface='node%s' % (instance.hostId)) 
             if_client_id = Xrn(if_xrn.urn, type='interface', id="eth%s" %if_index).urn
+            if_sliver_id = Xrn(rspec_node['sliver_id'], type='slice', id="eth%s" %if_index).urn
             interface = Interface({'component_id': if_xrn.urn,
-                                   'client_id': if_client_id})
+                                   'client_id': if_client_id,
+                                   'sliver_id': if_sliver_id})
             interface['ips'] =  [{'address': private_ip['addr'],
                                  #'netmask': private_ip['network'],
                                  'type': private_ip['version']}]
index 2984591..7144fa9 100644 (file)
@@ -8,7 +8,7 @@ class PGv2Interface:
     def add_interfaces(xml, interfaces):
         if isinstance(interfaces, list):
             for interface in interfaces:
-                if_elem = xml.add_instance('interface', interface, ['component_id', 'client_id'])
+                if_elem = xml.add_instance('interface', interface, ['component_id', 'client_id', 'sliver_id'])
                 ips = interface.get('ips', [])
                 for ip in ips:
                     if_elem.add_instance('ip', {'address': ip.get('address'),