From 236482413bda633700271e8f87ae0e99193f1198 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Thu, 21 Aug 2014 15:53:34 -0400 Subject: [PATCH] Bug 1055014 - Fix mistake in mozdevice.pushDir that is causing an exception while trying to use zip/unzip, r=wlach --- .../mozbase/mozdevice/mozdevice/devicemanagerADB.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py index 1bbd9215f36..7b2e20bceaf 100644 --- a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py +++ b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py @@ -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: