7b77a4c57a
Juju 2.0 provides support for display of the version of an application deployed by a charm in juju status. Insert the os_application_version_set function into the existing assess_status function - this gets called after all hook executions, and periodically after that, so any changes in package versions due to normal system updates will also be reflected in the status output. This review also includes a resync of charm-helpers to pickup hookenv and contrib.openstack support for this feature. Change-Id: I059d03fd0ae0c445b5822b3e48476e54b839689d
18 lines
538 B
Python
18 lines
538 B
Python
import subprocess
|
|
import os
|
|
|
|
|
|
def persistent_modprobe(module):
|
|
"""Load a kernel module and configure for auto-load on reboot."""
|
|
if not os.path.exists('/etc/rc.modules'):
|
|
open('/etc/rc.modules', 'a')
|
|
os.chmod('/etc/rc.modules', 111)
|
|
with open('/etc/rc.modules', 'r+') as modules:
|
|
if module not in modules.read():
|
|
modules.write('modprobe %s\n' % module)
|
|
|
|
|
|
def update_initramfs(version='all'):
|
|
"""Updates an initramfs image."""
|
|
return subprocess.check_call(["dracut", "-f", version])
|