use sfa.rspecs.rspec_converter
[sfa.git] / sfa / rspecs / pg_rspec.py
index 109c2cf..a68bd31 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>"""
@@ -82,7 +81,7 @@ class PGRSpec(RSpec):
         for hostname in hostnames:
             if hostname in nodes_with_slivers:
                 continue
-            nodes = self.xml.xpath('//rspecv2:node[@component_name="%s"]' % hostname, namespaces=self.namespaces)
+            nodes = self.xml.xpath('//rspecv2:node[@component_name="%s"] | //node[@component_name="%s"]' % (hostname, hostname), namespaces=self.namespaces)
             if nodes:
                 node = nodes[0]
                 node.set('client_id', hostname)