bootstrap-vz/bootstrapvz/providers/kvm/tasks/packages.py
Anders Ingemann 9d8821235f Clone packages-kernels.yml pattern to other providers
GCE also gets its own file.
For now, this scales - but we might want to refactor when there is more that just the kernel package we need to choose from
2014-07-09 23:17:05 +02:00

18 lines
664 B
Python

from bootstrapvz.base import Task
from bootstrapvz.common import phases
from bootstrapvz.common.tasks import apt
class DefaultPackages(Task):
description = 'Adding image packages required for kvm'
phase = phases.preparation
predecessors = [apt.AddDefaultSources]
@classmethod
def run(cls, info):
import os.path
kernel_packages_path = os.path.join(os.path.dirname(__file__), 'packages-kernels.yml')
from bootstrapvz.common.tools import config_get
kernel_package = config_get(kernel_packages_path, [info.release_codename,
info.manifest.system['architecture']])
info.packages.add(kernel_package)