Changeset 4875e93


Ignore:
Timestamp:
Aug 24, 2010 2:01:19 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
88dbe63
Parents:
d49c11c
Message:

Use arguments more congruent with GENIAPI AM and remove the sliver credentials.
Also a couple small bugs: not initializing slice_urn when a terminateion of a
terminated allocation is requested and not writing the new credential to disk
after the renew call.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/protogeni_access.py

    rd49c11c r4875e93  
    944944                raise service_error(service_error.federant,
    945945                        "No URN returned for slice %s" % hrn)
     946
     947            if 'creator_urn' in data:
     948                creator_urn = data['creator_urn']
     949            else:
     950                raise service_error(service_error.federant,
     951                        "No creator URN returned for slice %s" % hrn)
    946952            # Populate the ssh keys (let PG format them)
    947953            param = {
     
    954960                    'credentials': [ slice_cred ],
    955961                    'rspec': rspec,
    956                     'keys': keys,
     962                    'users': [ {
     963                        'urn': creator_urn,
     964                        'keys': keys,
     965                        },
     966                    ],
    957967                    'slice_urn': slice_urn,
    958968                    }
     
    963973                    "ProtoGENI: %s %s" % (e.code, e))
    964974
    965         return (slice_urn, slice_cred, sliver_cred, manifest)
    966 
    967     def wait_for_slice(self, segment_commands, sliver_cred, slice_urn, ctxt,
     975        return (slice_urn, slice_cred, manifest)
     976
     977    def wait_for_slice(self, segment_commands, slice_cred, slice_urn, ctxt,
    968978            timeout=None):
    969979        """
     
    978988            while status not in completed_states:
    979989                param = {
    980                         'credentials': [ sliver_cred ],
     990                        'credentials': [ slice_cred ],
    981991                        'slice_urn': slice_urn,
    982992                        }
     
    10341044        slicename = self.get_free_slicename(segment_commands, user, gcred, ctxt)
    10351045        self.log.info("Creating %s" % slicename)
    1036         slice_urn, slice_cred, sliver_cred, manifest = self.allocate_slice(
     1046        slice_urn, slice_cred, manifest = self.allocate_slice(
    10371047                segment_commands, slicename, rspec, gcred, ctxt)
    10381048
     
    10591069
    10601070        # Now we wait for the nodes to start on PG
    1061         status = self.wait_for_slice(segment_commands, sliver_cred, slice_urn,
     1071        status = self.wait_for_slice(segment_commands, slice_cred, slice_urn,
    10621072                ctxt, timeout=300)
    10631073        if status == 'failed':
     
    10751085            self.allocation[aid]['slice_name'] = slicename
    10761086            self.allocation[aid]['slice_credential'] = slice_cred
    1077             self.allocation[aid]['sliver_credential'] = sliver_cred
    10781087            self.allocation[aid]['manifest'] = manifest
    10791088            self.allocation[aid]['certfile'] = certfile
     
    13931402            cf, user, ssh_key, cpw = (None, None, None, None)
    13941403            slice_cred = None
     1404            slice_urn = None
    13951405            ename = None
    13961406        self.state_lock.release()
     
    15001510                    if self.allocation.has_key(aid):
    15011511                        self.allocation[aid]['slice_credential'] = new_scred
     1512                        self.write_state()
    15021513                    self.state_lock.release()
    15031514                else:
Note: See TracChangeset for help on using the changeset viewer.