[autotest] remove .pyc files during server deployment

Remove stale .pyc files after syncing code.

BUG=chromium:616277
TEST=Test locally and unittest

Change-Id: Ie7cc55d71b1ccc84efe7704d60db476e284cf662
Reviewed-on: https://chromium-review.googlesource.com/435041
Reviewed-by: Shuqian Zhao <shuqianz@chromium.org>
Tested-by: Shuqian Zhao <shuqianz@chromium.org>
diff --git a/site_utils/deploy_server_local.py b/site_utils/deploy_server_local.py
index d109c6e..634dce8 100755
--- a/site_utils/deploy_server_local.py
+++ b/site_utils/deploy_server_local.py
@@ -156,6 +156,9 @@
     else:
         print('Updating server to prod branch')
         subprocess.check_output(['git', 'checkout', 'cros/prod'])
+    # Remove .pyc files via pyclean, which is a package on all ubuntu server.
+    print('Removing .pyc files')
+    subprocess.check_output(['pyclean', '.', '-q'])
 
 
 def discover_update_commands():
@@ -460,6 +463,9 @@
     print('Updating ~chromeos-test/chromiumos')
     with ChangeDir(os.path.expanduser('~chromeos-test/chromiumos')):
         ret = subprocess.call(['repo', 'sync'])
+        # Remove .pyc files via pyclean, which is a package on all ubuntu server
+        print('Removing .pyc files')
+        subprocess.check_output(['pyclean', '.', '-q'])
     if ret != 0:
         print('Update failed, exited with status: %d' % ret)