Changeset 57facae for fedd/federation
- Timestamp:
- Nov 29, 2011 4:28:34 PM (13 years ago)
- Branches:
- compt_changes, info-ops, master
- Children:
- 22a1a77
- Parents:
- ab3d6c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/experiment_control.py
rab3d6c5 r57facae 1745 1745 def get_testbed_services(self, req, testbeds): 1746 1746 """ 1747 Parse the services section of the request into a dict mapping 1748 testbed to lists of federated_service objects. The dict maps all 1749 exporters of services to those service objects. 1750 """ 1747 Parse the services section of the request into two dicts mapping 1748 testbed to lists of federated_service objects. The first dict maps all 1749 exporters of services to those service objects, the second maps 1750 testbeds to service objects only for services requiring portals. 1751 """ 1752 # We construct both dicts here because deriving the second is more 1753 # comples than it looks - both the keys and lists can differ, and it's 1754 # much easier to generate both in one pass. 1751 1755 masters = { } 1756 pmasters = { } 1752 1757 for s in req.get('service', []): 1753 1758 # If this is a service request with the importall field … … 1776 1781 if tb in masters: masters[tb].append(fser) 1777 1782 else: masters[tb] = [fser] 1783 1784 if fser.portal: 1785 if tb in pmasters: pmasters[tb].append(fser) 1786 else: pmasters[tb] = [fser] 1778 1787 else: 1779 1788 self.log.error('Testbed service does not have name " + \ 1780 1789 "and importers') 1781 return masters 1790 return masters, pmasters 1782 1791 1783 1792 def generate_keys_and_hosts(self, tmpdir, expid, hosts, tbparams): … … 2079 2088 testbeds.append(tb) 2080 2089 2081 masters = self.get_testbed_services(req, testbeds) 2082 # The exporters who need portals 2083 pmasters = dict([(k, [s for s in l if s.portal] ) \ 2084 for k, l in masters.items()]) 2090 masters, pmasters = self.get_testbed_services(req, testbeds) 2085 2091 allocated = { } # Testbeds we can access 2086 2092 topo ={ } # Sub topologies
Note: See TracChangeset
for help on using the changeset viewer.