blob: 1465e8ed4a991d7904e797b2ce123e1b3d6b93de [file] [log] [blame]
#!/usr/bin/env python3
# Load modules from $CHARM_DIR/lib
import os
import sys
sys.path.append('lib')
# This is an upgrade-charm context, make sure we install latest deps
if not os.path.exists('wheelhouse/.upgrade'):
open('wheelhouse/.upgrade', 'w').close()
if os.path.exists('wheelhouse/.bootstrapped'):
os.unlink('wheelhouse/.bootstrapped')
else:
os.unlink('wheelhouse/.upgrade')
from charms.layer import basic
basic.bootstrap_charm_deps()
basic.init_config_states()
# This will load and run the appropriate @hook and other decorated
# handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive,
# and $CHARM_DIR/hooks/relations.
#
# See https://jujucharms.com/docs/stable/authors-charm-building
# for more information on this pattern.
from charms.reactive import main
main()