Changeset 2627eb3 for fedd/federation
- Timestamp:
- Dec 12, 2010 9:51:41 AM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master
- Children:
- e83f2f2
- Parents:
- 9973d57
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/experiment_control.py
r9973d57 r2627eb3 1375 1375 topo[tb].make_indices() 1376 1376 1377 def confirm_software(self, top): 1378 """ 1379 Make sure that the software to be loaded in the topo is all available 1380 before we begin making access requests, etc. This is a subset of 1381 wrangle_software. 1382 """ 1383 pkgs = set([ d for i, d in self.fedkit + self.gatewaykit ]) 1384 pkgs.update([x.location for e in top.elements for x in e.software]) 1385 1386 for pkg in pkgs: 1387 loc = pkg 1388 1389 scheme, host, path = urlparse(loc)[0:3] 1390 dest = os.path.basename(path) 1391 if not scheme: 1392 if not loc.startswith('/'): 1393 loc = "/%s" % loc 1394 loc = "file://%s" %loc 1395 # NB: if scheme was found, loc == pkg 1396 try: 1397 u = urlopen(loc) 1398 u.close() 1399 except Exception, e: 1400 raise service_error(service_error.req, 1401 "Cannot open %s: %s" % (loc, e)) 1402 return True 1403 1377 1404 def wrangle_software(self, expid, top, topo, tbparams): 1378 1405 """ … … 1387 1414 softdir ="%s/%s" % ( self.repodir, linkpath) 1388 1415 softmap = { } 1389 # These are in a list of tuples format (each kit). This comprehension 1390 # unwraps them into a single list of tuples that initilaizes the set of 1391 # tuples. 1392 pkgs = set([ t for l in [self.fedkit, self.gatewaykit] \ 1393 for p, t in l ]) 1394 pkgs.update([x.location for e in top.elements \ 1395 for x in e.software]) 1416 1417 # self.fedkit and self.gateway kit are lists of tuples of 1418 # (install_location, download_location) this extracts the download 1419 # locations. 1420 pkgs = set([ d for i, d in self.fedkit + self.gatewaykit ]) 1421 pkgs.update([x.location for e in top.elements for x in e.software]) 1396 1422 try: 1397 1423 os.makedirs(softdir) … … 1410 1436 loc = "/%s" % loc 1411 1437 loc = "file://%s" %loc 1438 # NB: if scheme was found, loc == pkg 1412 1439 try: 1413 1440 u = urlopen(loc) … … 1946 1973 1947 1974 top = self.get_topology(req, tmpdir) 1975 self.confirm_software(top) 1948 1976 # Assign the IPs 1949 1977 hosts, ip_allocator = self.allocate_ips_to_topo(top) … … 1964 1992 connInfo = { } # Connection information 1965 1993 1994 self.split_topology(top, topo, testbeds) 1995 1966 1996 self.get_access_to_testbeds(testbeds, fid, allocated, 1967 1997 tbparams, masters, tbmap, expid, expcert_file) 1968 1969 self.split_topology(top, topo, testbeds)1970 1998 1971 1999 attrs = self.generate_keys_and_hosts(tmpdir, expid, hosts, tbparams)
Note: See TracChangeset
for help on using the changeset viewer.