Changeset 5f96438 for fedd/federation/experiment_control.py
- Timestamp:
- Apr 7, 2010 11:14:49 AM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- c23684d
- Parents:
- 73e7f5c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/experiment_control.py
r73e7f5c r5f96438 886 886 "uri": uri, 887 887 } 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} ] 889 901 services.extend(r['service']) 890 902 … … 1614 1626 testbeds = set([ a.value for e in top.elements \ 1615 1627 for a in e.attribute \ 1616 if a.attribute == 'testbed'])1628 if a.attribute == 'testbed']) 1617 1629 1618 1630 allocated = { } # Testbeds we can access … … 1620 1632 connInfo = { } # Connection information 1621 1633 services = [ ] 1634 masters = { } # testbeds exporting services 1622 1635 self.get_access_to_testbeds(testbeds, access_user, 1623 1636 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 1624 1653 self.split_topology(top, topo, testbeds) 1625 1654 … … 1658 1687 part = experiment_partition(self.auth, self.store_url, self.tbmap, 1659 1688 self.muxmax) 1660 part.add_portals(top, topo, eid, master , tbparams, ip_allocator,1689 part.add_portals(top, topo, eid, masters, tbparams, ip_allocator, 1661 1690 connInfo, expid) 1662 1691 # Now get access to the dynamic testbeds
Note: See TracChangeset
for help on using the changeset viewer.