charm-ceph-radosgw/tests/charmhelpers/core/kernel_factory/ubuntu.py
David Ames a2d8f0191e Pre-release charm-helpers sync 17.02
Get each charm up to date with lp:charm-helpers for release testing.

Change-Id: I3fd359025a7be468fcc856cab7f42894a318e90f
2017-02-14 14:45:35 -08:00

14 lines
406 B
Python

import subprocess
def persistent_modprobe(module):
"""Load a kernel module and configure for auto-load on reboot."""
with open('/etc/modules', 'r+') as modules:
if module not in modules.read():
modules.write(module + "\n")
def update_initramfs(version='all'):
"""Updates an initramfs image."""
return subprocess.check_call(["update-initramfs", "-k", version, "-u"])