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>"""
#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)