Ignore:
Timestamp:
Apr 7, 2010 11:14:49 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
c23684d
Parents:
73e7f5c
Message:

checkpoint for download - not tested

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    r73e7f5c r5f96438  
    886886                "uri": uri,
    887887                }
    888         if 'service' in r:
     888        if 'service' in r:
     889            for s in r['service']:
     890                # Tag each service with the origin testbed
     891                if s.has_key('fedAttr'):
     892                    # The else connects with the for
     893                    for a in s['fedAttr']:
     894                        if a.get('attribute', None) == 'testbed'):
     895                            break
     896                    else:
     897                        s['fedAttr'].append({'attribute': 'testbed',
     898                            'value': tb})
     899                else:
     900                    s['fedAttr'] = [ {'attribute': 'testbed', 'value': tb} ]
    889901            services.extend(r['service'])
    890902
     
    16141626            testbeds = set([ a.value for e in top.elements \
    16151627                    for a in e.attribute \
    1616                     if a.attribute == 'testbed'] )
     1628                        if a.attribute == 'testbed'])
    16171629
    16181630            allocated = { }         # Testbeds we can access
     
    16201632            connInfo = { }          # Connection information
    16211633            services = [ ]
     1634            masters = { }           # testbeds exporting services
    16221635            self.get_access_to_testbeds(testbeds, access_user,
    16231636                    export_project, master, allocated, tbparams, services)
     1637
     1638            # After this masters will hold a set of services exported by each
     1639            # testbed
     1640            for s in services:
     1641                i = s.get('visibility', 'import')
     1642                if i == 'export':
     1643                    for a in s.get('fedAttr', []):
     1644                        if a.get('attribute', '') == 'testbed':
     1645                            tb = a.get('value', None)
     1646                            if tb:
     1647                                if masters.has_key(tb): masters[tb].add(s.name)
     1648                                else: masters[tb] = set([s.name])
     1649                            else:
     1650                                log.error('Testbed attribute with no value?')
     1651
     1652
    16241653            self.split_topology(top, topo, testbeds)
    16251654
     
    16581687            part = experiment_partition(self.auth, self.store_url, self.tbmap,
    16591688                    self.muxmax)
    1660             part.add_portals(top, topo, eid, master, tbparams, ip_allocator,
     1689            part.add_portals(top, topo, eid, masters, tbparams, ip_allocator,
    16611690                    connInfo, expid)
    16621691            # Now get access to the dynamic testbeds
Note: See TracChangeset for help on using the changeset viewer.