expose slice tags in SFA RSepc
[sfa.git] / sfa / rspecs / pg_rspec.py
index 194361e..d1c4ea7 100755 (executable)
@@ -6,7 +6,6 @@ from sfa.util.xrn import *
 from sfa.util.plxrn import hostname_to_urn
 from sfa.util.config import Config  
 
-
 class PGRSpec(RSpec):
     header = '<?xml version="1.0"?>\n'
     template = """<rspec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.protogeni.net/resources/rspec/0.2" xsi:schemaLocation="http://www.protogeni.net/resources/rspec/0.2 http://www.protogeni.net/resources/rspec/0.2/ad.xsd"></rspec>"""
@@ -74,12 +73,13 @@ class PGRSpec(RSpec):
             #if 'interfaces' in node:
             
 
-    def add_slivers(self, hostnames, check_for_dupes=False): 
-        if not isinstance(hostnames, list):
-            hostnames = [hostnames]
+    def add_slivers(self, slivers, check_for_dupes=False): 
+        if not isinstance(slivers, list):
+            slivers = [slivers]
 
         nodes_with_slivers = self.get_nodes_with_slivers()
-        for hostname in hostnames:
+        for sliver in slivers:
+            hostname = sliver['hostname']
             if hostname in nodes_with_slivers:
                 continue
             nodes = self.xml.xpath('//rspecv2:node[@component_name="%s"] | //node[@component_name="%s"]' % (hostname, hostname), namespaces=self.namespaces)