migration.py
changeset 9829 e0e71b45bf8d
parent 9294 769b8867f8ce
child 9897 fa44db7da2dc
child 10060 08dc10ef9ab1
equal deleted inserted replaced
9828:ad0d461ae18b 9829:e0e71b45bf8d
   411             toremove = self.config.expand_cubes([cube])
   411             toremove = self.config.expand_cubes([cube])
   412         else:
   412         else:
   413             toremove = (cube,)
   413             toremove = (cube,)
   414         origcubes = self.config._cubes
   414         origcubes = self.config._cubes
   415         basecubes = [c for c in origcubes if not c in toremove]
   415         basecubes = [c for c in origcubes if not c in toremove]
   416         self.config._cubes = tuple(self.config.expand_cubes(basecubes))
   416         # don't fake-add any new ones, or we won't be able to really-add them later
       
   417         self.config._cubes = tuple(cube for cube in self.config.expand_cubes(basecubes)
       
   418                                    if cube in origcubes)
   417         removed = [p for p in origcubes if not p in self.config._cubes]
   419         removed = [p for p in origcubes if not p in self.config._cubes]
   418         if not cube in removed and cube in origcubes:
   420         if not cube in removed and cube in origcubes:
   419             raise ConfigurationError("can't remove cube %s, "
   421             raise ConfigurationError("can't remove cube %s, "
   420                                      "used as a dependency" % cube)
   422                                      "used as a dependency" % cube)
   421         return removed
   423         return removed