Remove the compiled python bytecode

upgrade-charm could previously fail because of compiled
bytecode remaining behind. This change makes the upgrade-charm
hook remove any such compiled bytecode files

Closes-Bug: 1628322

Change-Id: I3886b514b47d6fc9fdfb350e2b3a2296472e40f6
This commit is contained in:
Chris MacNaughton 2016-10-03 13:16:30 -04:00
parent 6ba551b13e
commit 0dd383d351
No known key found for this signature in database
GPG Key ID: 74BAF13D12E6A841
3 changed files with 8 additions and 2 deletions

View File

@ -446,7 +446,7 @@ def mon_relation():
log('mon cluster has not yet provided conf')
@hooks.hook('upgrade-charm')
@hooks.hook('upgrade-charm.real')
@harden()
def upgrade_charm():
if get_fsid() and get_auth():

View File

@ -1 +0,0 @@
ceph_hooks.py

6
hooks/upgrade-charm Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# Wrapper to ensure that old python bytecode isn't hanging around
# after we upgrade the charm with newer libraries
rm -rf **/*.pyc
exec ./hooks/upgrade-charm.real

1
hooks/upgrade-charm.real Symbolic link
View File

@ -0,0 +1 @@
ceph_hooks.py