From: Tony Mack Date: Fri, 20 Nov 2009 19:51:05 +0000 (+0000) Subject: in redeem_ticket() - no need to require rspec as a command arguemt, get rspec from... X-Git-Tag: sfa-0.9-7~301 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=31a3999226eb16a573f961da4a6f133c77553723;p=sfa.git in redeem_ticket() - no need to require rspec as a command arguemt, get rspec from the ticket. get the slice hrn from the ticket also --- diff --git a/sfa/client/sfi.py b/sfa/client/sfi.py index 5a2467dd..ed884eae 100755 --- a/sfa/client/sfi.py +++ b/sfa/client/sfi.py @@ -824,18 +824,19 @@ class Sfi: ticket.save_to_file(filename=file, save_parents=True) def redeem_ticket(self, opts, args): - ticket_file, rspec_file = args[0], args[1] + ticket_file = args[0] # get slice hrn from the ticket + # use this to get the right slice credential ticket = SfaTicket(filename=ticket_file) ticket.decode() - slice_hrn = ticket.attributes['hrn'] + slice_hrn = ticket.attributes['slivers'][0]['hrn'] user_cred = self.get_user_cred() slice_cred = self.get_slice_cred(slice_hrn).save_to_string(save_parents=True) # get a list node hostnames from the nodespecs in the rspec rspec = RSpec() - rspec.parseFile(rspec_file) + rspec.parseString(ticket.rspec) nodespecs = rspec.getDictsByTagName('NodeSpec') hostnames = [nodespec['name'] for nodespec in nodespecs]