~bjornt/charms/trusty/swift-storage/forward-port-bug-1350049-fix

« back to all changes in this revision

Viewing changes to hooks/swift_storage_hooks.py

  • Committer: james.page at ubuntu
  • Date: 2014-10-09 15:26:30 UTC
  • mfrom: (44.1.1 swift-storage)
  • Revision ID: james.page@ubuntu.com-20141009152630-ytvi3at215xcndnm
[james-page,r=coreycb] Fixup upgrade issues with missing psutil

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    relation_set,
25
25
)
26
26
 
27
 
from charmhelpers.fetch import apt_install, apt_update
 
27
from charmhelpers.fetch import (
 
28
    apt_install,
 
29
    apt_update,
 
30
    filter_installed_packages
 
31
)
28
32
from charmhelpers.core.host import restart_on_change
29
33
from charmhelpers.payload.execd import execd_preinstall
30
34
 
62
66
    save_script_rc()
63
67
 
64
68
 
 
69
@hooks.hook('upgrade-charm')
 
70
def upgrade_charm():
 
71
    apt_install(filter_installed_packages(PACKAGES), fatal=True)
 
72
 
 
73
 
65
74
@hooks.hook()
66
75
def swift_storage_relation_joined():
67
76
    devs = [os.path.basename(dev) for dev in determine_block_devices()]