bootstrap-vz/bootstrapvz/providers/kvm/tasks/virtio.py

17 lines
506 B
Python
Raw Normal View History

from bootstrapvz.base import Task
from bootstrapvz.common import phases
2014-01-30 11:44:26 +01:00
import os
class VirtIO(Task):
description = 'Install virtio modules'
phase = phases.system_modification
2014-01-30 11:44:26 +01:00
@classmethod
def run(cls, info):
modules = os.path.join(info.root, '/etc/initramfs-tools/modules')
with open(modules, "a") as modules_file:
modules_file.write("\n")
for module in info.manifest.provider.get('virtio', []):
modules_file.write(module + "\n")