[autotest] Don't fail deploy_server when removing .pyc files failed

One server failed to remove .pyc under container folder, and then push
failed due to this. pyclean dooesn't have the option to exclude certain
dir, and it should have not cleaned the dir it does not have the permission.
This issue only happens on one server. Add workaround to not fail
deploy_server when fail to remove .pyc files.

BUG=chromium:690225
TEST=unittest

Change-Id: I7e7c58036d25451cdf224700b8470fd1a4f73e4d
Reviewed-on: https://chromium-review.googlesource.com/439810
Commit-Ready: Shuqian Zhao <shuqianz@chromium.org>
Tested-by: Shuqian Zhao <shuqianz@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
diff --git a/site_utils/deploy_server_local.py b/site_utils/deploy_server_local.py
index 285d944..c23ad1b 100755
--- a/site_utils/deploy_server_local.py
+++ b/site_utils/deploy_server_local.py
@@ -160,8 +160,10 @@
                                 stderr=subprocess.STDOUT)
     # Remove .pyc files via pyclean, which is a package on all ubuntu server.
     print('Removing .pyc files')
-    subprocess.check_output(['pyclean', '.', '-q'])
-
+    try:
+        subprocess.check_output(['pyclean', '.', '-q'])
+    except Exception as e:
+        print('Warning: fail to remove .pyc! %s' % e)
 
 def discover_update_commands():
     """Lookup the commands to run on this server.
@@ -467,7 +469,10 @@
         ret = subprocess.call(['repo', 'sync'], stderr=subprocess.STDOUT)
         # Remove .pyc files via pyclean, which is a package on all ubuntu server
         print('Removing .pyc files')
-        subprocess.check_output(['pyclean', '.', '-q'])
+        try:
+            subprocess.check_output(['pyclean', '.', '-q'])
+        except Exception as e:
+            print('Warning: fail to remove .pyc! %s' % e)
     if ret != 0:
         print('Update failed, exited with status: %d' % ret)