/usr/lib/python2.7/dist-packages/charmtools/templates/python/files/hooks/upgrade-charm is in charm-tools 2.1.2-0ubuntu4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #!/usr/bin/python
import os
import sys
sys.path.insert(0, os.path.join(os.environ['CHARM_DIR'], 'lib'))
from charmhelpers.core import (
hookenv,
host,
)
hooks = hookenv.Hooks()
log = hookenv.log
SERVICE = '$metadata.package'
@hooks.hook('upgrade-charm')
def upgrade_charm():
log('Upgrading $metadata.package')
if __name__ == "__main__":
# execute a hook based on the name the program is called by
hooks.execute(sys.argv)
|