From 8f0e97c1460f015f4eb03a8221b4b02b61559d9d Mon Sep 17 00:00:00 2001 From: WenyanZhang Date: Thu, 7 Jul 2016 18:57:32 +0800 Subject: [PATCH] Remove all *.pyc files in $DEST when executing clean.sh Currentlly, the *.pyc files could not be removed in any scripts or functions. But the redundant files would lead stack.sh not to find the correct script for some versions after branch switched from master to stable/mitaka in migration_helpers.sync_database_to_version. So this commit adds the process of cleaning all the *.pyc files in clean.sh. It is needed to execute clean.sh before re-stack.sh to prevent the exception. Change-Id: I9ba0674d6b20b13c0a26b22cd5d1939daa121a94 Closes-Bug: #1599124 --- clean.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clean.sh b/clean.sh index 0641bffcf8..e0ec9f5315 100755 --- a/clean.sh +++ b/clean.sh @@ -145,3 +145,8 @@ for file in $FILES_TO_CLEAN; do done rm -rf ~/.config/openstack + +# Clean up all *.pyc files +if [[ -n "$DEST" ]] && [[ -d "$DEST" ]]; then + sudo find $DEST -name "*.pyc" -print0 | xargs -0 rm +fi