Ignore:
Timestamp:
Nov 11, 2010 8:59:19 AM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
version-3.01
Parents:
807b5ca
Message:

This rolls back the 3.01 branch to the original 3.01 state. I erroneously kept the changes between 3.01 and 3.02 in this branch. With the new branch created, this restores the 3.01 tag's correctness.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/protogeni_access.py

    r807b5ca r5b19c3a  
    344344                        self.d[self.current_key] = {
    345345                                'hostname': attrs.get('hostname', None),
    346                                 'interfaces': { },
    347                                 'mac': { }
     346                                'interfaces': { }
    348347                                }
    349348                elif name == 'interface' and self.current_key:
     
    351350                            [attrs.get('virtual_id','')] = \
    352351                            attrs.get('component_id', None)
    353                 elif name == 'interface_ref':
    354                     # Collect mac address information from an interface_ref.
    355                     # These appear after the node info has been parsed.
    356                     nid = attrs.get('virtual_node_id', None)
    357                     ifid = attrs.get('virtual_interface_id', None)
    358                     mac = attrs.get('MAC', None)
    359                     self.d[nid]['mac'][ifid] = mac
    360352            #  When a node is finished, clear current_key
    361353            def end_element(self, name):
     
    660652
    661653        ifconfig = "/sbin/ifconfig"
    662         findif = '/usr/local/etc/emulab/findif'
    663654        stage_file = stage_file_type(user, self.staging_host, stagingdir)
    664655        pname = node.get('hostname', None)
     
    675666                    if not i.get_attribute('portal')]:
    676667                pinf = node['interfaces'].get(i.name, None)
    677                 pmac = node['mac'].get(i.name, None)
    678668                addr = i.get_attribute('ip4_address')
    679669                netmask = i.get_attribute('ip4_netmask') or '255.255.255.0'
    680                 # The interface names in manifests are not to be trusted, so we
    681                 # find the interface to configure using the local node's script
    682                 # to match mac address to interface name.
    683                 if pinf and addr and pmac:
    684                     print >>script, '# %s' % pinf
     670                if pinf and addr:
    685671                    print >>script, \
    686                             "%s `%s %s` %s netmask %s"  % \
    687                             (ifconfig, findif, pmac, addr, netmask)
     672                            "%s %s %s netmask %s"  % \
     673                            (ifconfig, pinf, addr, netmask)
    688674                else:
    689675                    self.log.error("Missing interface or address for %s" \
     
    944930                    "ProtoGENI: %s %s" % (e.code, e))
    945931
    946         return (slice_urn, slice_cred, manifest, rspec)
     932        return (slice_urn, slice_cred, manifest)
    947933
    948934    def wait_for_slice(self, segment_commands, slice_cred, slice_urn, ctxt,
     
    1011997                certfile, certpw)
    1012998
    1013         if not ctxt: return False, {}
     999        if not ctxt: return False
    10141000
    10151001        self.set_up_staging_filespace(segment_commands, user, host, stagingdir)
    10161002        slicename = self.get_free_slicename(segment_commands, user, gcred, ctxt)
    10171003        self.log.info("Creating %s" % slicename)
    1018         slice_urn, slice_cred, manifest, rpsec = self.allocate_slice(
     1004        slice_urn, slice_cred, manifest = self.allocate_slice(
    10191005                segment_commands, slicename, rspec, gcred, ctxt)
    10201006
     
    10371023                                user, host, "%s/%s" % (stagingdir, f)):
    10381024                            self.log.error("Scp failed")
    1039                             return False, {}
     1025                            return False
    10401026
    10411027
     
    10461032            self.log.error('Sliver failed to start on ProtoGENI')
    10471033            self.delete_slice(segment_commands, slice_cred, slice_urn, ctxt)
    1048             return False, {}
     1034            return False
    10491035        elif status == 'timeout':
    10501036            self.log.error('Sliver failed to start on ProtoGENI (timeout)')
    10511037            self.delete_slice(segment_commands, slice_cred, slice_urn, ctxt)
    1052             return False, {}
     1038            return False
    10531039        else:
    10541040            # All good: save ProtoGENI info in shared state
     
    10581044            self.allocation[aid]['slice_credential'] = slice_cred
    10591045            self.allocation[aid]['manifest'] = manifest
    1060             self.allocation[aid]['rspec'] = rspec
    10611046            self.allocation[aid]['certfile'] = certfile
    10621047            self.allocation[aid]['certpw'] = certpw
     
    14111396            param = {
    14121397                    'credential': cred,
    1413                     'urn': slice_urn,
     1398                    'hrn': name,
     1399                    'type': 'Slice',
     1400                    }
     1401            slice = segment_commands.slice_authority_call('Resolve',
     1402                    param, ctxt)
     1403            uuid = slice.get('uuid', None)
     1404            if uuid == None:
     1405                sys.exit('No uuid for %s' % slicename)
     1406
     1407            print 'Calling GetCredential (uuid)'
     1408            param = {
     1409                    'credential': cred,
     1410                    'uuid': uuid,
    14141411                    'type': 'Slice',
    14151412                    }
     
    14211418            return None
    14221419        try:
     1420            print 'Calling RenewSlice (CM)'
    14231421            param = {
    14241422                    'credentials': [new_scred,],
Note: See TracChangeset for help on using the changeset viewer.