try:
rspec.add_slivers(nodes)
except:
- print >> sys.stderr, "FAILED: %s" % node
+ print >> sys.stderr, "FAILED: %s" % nodes
print >>outfile, rspec.toxml()
api.plshell.BindObjectToPeer(api.plauth, 'slice', slice.id, peer,
slice.peer_id)
- return aggregate.get_rspec(slice_xrn=slice_xrn)
+ return aggregate.get_rspec(slice_xrn=slice_xrn, version=RSpecVersion("pg"))
def RenewSliver(api, xrn, creds, expiration_time, call_id):
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)
from sfa.util.sfalogging import _SfaLogger
-DEFAULT_FORMAT='sfa'
-DEFAULT_VERSION_NUMBER=1
class RSpecVersion:
- format = None
- version = None
+ format = 'sfa'
+ version = '1'
schema = None
namespace = None
extensions = []
def parse_version_string(self, version_string):
# version_raw is currently a string but will
# eventually be a struct.
- try:
- format_split = version_string.split(' ')
- format, version = format_split[0].lower(), format_split[1]
- except:
- self.logger.info("RSpecVersion: invalid rspec version string: %s , using default" \
- % version_string)
- # invalid format. Just continue
- format, version = DEFAULT_FORMAT, DEFAULT_VERSION_NUMBER
-
- self.format = format
- self.version = version
+ format_split = version_string.split(' ')
+ try: self.format = format_split[0].lower()
+ except: pass
+ try: self.version = format_split[1]
+ except: pass
def parse_version_struct(self, version_struct):
try:
pass
except:
- format, version = DEFAULT_FORMAT, DEFAULT_VERSION_NUMBER
+ pass
rl.add("refresh")
rl.add("resolve")
rl.add("info")
- elif type == "sa":
+ elif type in ["sa", "authority+sa"]:
rl.add("authority")
rl.add("sa")
- elif type == "ma":
+ elif type ["ma", "authority+ma"]::
rl.add("authority")
rl.add("ma")
elif type == "authority":