def _create_services(self, *versions): cells = objects.CellMappingList.get_all(self.context) index = 0 for version in versions: service = objects.Service(context=self.context, binary='nova-compute') service.version = version cell = cells[index % len(cells)] with context.target_cell(self.context, cell): service.create() index += 1