~postgresql-charmers/postgresql-charm/built

« back to all changes in this revision

Viewing changes to hooks/upgrade-charm

  • Committer: Stuart Bishop
  • Date: 2016-02-18 10:53:55 UTC
  • Revision ID: git-v1:a0c4e5cb498bcf9402f52809730edbd220edf665
charm-build of master

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python3
 
2
 
 
3
# Load modules from $CHARM_DIR/lib
 
4
import os
 
5
import sys
 
6
sys.path.append('lib')
 
7
 
 
8
# This is an upgrade-charm context, make sure we install latest deps
 
9
if not os.path.exists('wheelhouse/.upgrade'):
 
10
    open('wheelhouse/.upgrade', 'w').close()
 
11
    if os.path.exists('wheelhouse/.bootstrapped'):
 
12
        os.unlink('wheelhouse/.bootstrapped')
 
13
else:
 
14
    os.unlink('wheelhouse/.upgrade')
 
15
 
 
16
from charms.layer import basic
 
17
basic.bootstrap_charm_deps()
 
18
basic.init_config_states()
 
19
 
 
20
 
 
21
# This will load and run the appropriate @hook and other decorated
 
22
# handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive,
 
23
# and $CHARM_DIR/hooks/relations.
 
24
#
 
25
# See https://jujucharms.com/docs/stable/authors-charm-building
 
26
# for more information on this pattern.
 
27
from charms.reactive import main
 
28
main()