Ubuntu Pastebin

Paste from james beedy at Wed, 1 Feb 2017 20:48:31 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# reactive/my_charm.py

from charmhelpers.core.hookenv import Hooks, status_set, log


hooks = Hooks()
hook = hooks.hook


@hook('upgrade-charm')
def replace_war_on_upgrade():
    log("Upgrading Resource")
    status_set('maintenance', "Upgrading resource")
    install_copy_war()
    status_set('active', "Resource upgraded")
Download as text