Bug 1055014 - Fix mistake in mozdevice.pushDir that is causing an exception while trying to use zip/unzip, r=wlach

This commit is contained in:
Andrew Halberstadt 2014-08-21 15:53:34 -04:00
parent c8a8492449
commit 236482413b

View File

@ -7,6 +7,7 @@ import os
import shutil
import tempfile
import time
import traceback
from devicemanager import DeviceManager, DMError
from mozprocess import ProcessHandler
@ -221,8 +222,10 @@ class DeviceManagerADB(DeviceManager):
try:
localZip = tempfile.mktemp() + ".zip"
remoteZip = remoteDir + "/adbdmtmp.zip"
ProcessHandler(["zip", "-r", localZip, '.'], cwd=localDir,
processOutputLine=self._log).run().wait()
proc = ProcessHandler(["zip", "-r", localZip, '.'], cwd=localDir,
processOutputLine=self._log)
proc.run()
proc.wait()
self.pushFile(localZip, remoteZip, retryLimit=retryLimit, createDir=False)
mozfile.remove(localZip)
data = self._runCmd(["shell", "unzip", "-o", remoteZip,
@ -232,7 +235,8 @@ class DeviceManagerADB(DeviceManager):
if re.search("unzip: exiting", data) or re.search("Operation not permitted", data):
raise Exception("unzip failed, or permissions error")
except:
self._logger.info("zip/unzip failure: falling back to normal push")
self._logger.warning(traceback.format_exc())
self._logger.warning("zip/unzip failure: falling back to normal push")
self._useZip = False
self.pushDir(localDir, remoteDir, retryLimit=retryLimit)
else: