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

Change-Id: I1cb6521cab1ac0d529907d44f1e9bdb313a798ac
Closes-Bug: 1628322
This commit is contained in:
Chris MacNaughton 2016-10-03 13:14:04 -04:00
parent daa475a8c5
commit a62a1e5adb
No known key found for this signature in database
GPG Key ID: 74BAF13D12E6A841
3 changed files with 8 additions and 2 deletions

View File

@ -506,7 +506,7 @@ def client_relation_changed():
log('mon cluster not in quorum', level=DEBUG)
@hooks.hook('upgrade-charm')
@hooks.hook('upgrade-charm.real')
@harden()
def upgrade_charm():
emit_cephconf()

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