~ajkavanagh/charms/trusty/memcached/add-spaces-support

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/core/kernel_factory/ubuntu.py

  • Committer: Jorge Niedbalski
  • Date: 2016-09-20 18:01:20 UTC
  • mfrom: (72.2.3 memcached.py3)
  • Revision ID: jorge.niedbalski@canonical.com-20160920180120-apb4ut3cugwxcrer
[freyes, r=niedbalski] Fixes bug LP: #1576458

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import subprocess
 
2
 
 
3
 
 
4
def persistent_modprobe(module):
 
5
    """Load a kernel module and configure for auto-load on reboot."""
 
6
    with open('/etc/modules', 'r+') as modules:
 
7
        if module not in modules.read():
 
8
            modules.write(module)
 
9
 
 
10
 
 
11
def update_initramfs(version='all'):
 
12
    """Updates an initramfs image."""
 
13
    return subprocess.check_call(["update-initramfs", "-k", version, "-u"])