~ibmcharmers/charms/trusty/ibm-dsm-enterprise/devel

« back to all changes in this revision

Viewing changes to hooks/upgrade-charm

  • Committer: anita nayak
  • Date: 2016-12-08 14:10:42 UTC
  • Revision ID: anitanayak@in.ibm.com-20161208141042-jyicg7udd6liy6s3
Initial Check in for IBM DSM for trusty

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()