Browse code

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

WenyanZhang authored on 2016/07/07 19:57:32
Showing 1 changed files
... ...
@@ -145,3 +145,8 @@ for file in $FILES_TO_CLEAN; do
145 145
 done
146 146
 
147 147
 rm -rf ~/.config/openstack
148
+
149
+# Clean up all *.pyc files
150
+if [[ -n "$DEST" ]] && [[ -d "$DEST" ]]; then
151
+    sudo find $DEST -name "*.pyc" -print0 | xargs -0 rm
152
+fi