Revert "Re-land "[dev-util] Add symbolicate_dump endpoint to dev server""

This reverts commit 66e91c132f9651905a567978a97d192d485e03c4


Apparently, this causes the wait_for_status endpoint to return incorrectly.

Change-Id: Id06f5b2ae2bb6a0e005318ed7ea0661ec3ebd1ed
Reviewed-on: https://gerrit.chromium.org/gerrit/21642
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
diff --git a/devserver.py b/devserver.py
index 07c85ee..bb22e22 100755
--- a/devserver.py
+++ b/devserver.py
@@ -7,14 +7,11 @@
 """A CherryPy-based webserver to host images and build packages."""
 
 import cherrypy
-import cStringIO
 import logging
 import optparse
 import os
 import re
 import sys
-import subprocess
-import tempfile
 
 import autoupdate
 import devserver_util
@@ -243,41 +240,6 @@
     return return_obj
 
   @cherrypy.expose
-  def symbolicate_dump(self, minidump):
-    """Symbolicates a minidump using pre-downloaded symbols, returns it.
-
-    Callers will need to POST to this URL with a body of MIME-type
-    "multipart/form-data".
-    The body should include a single argument, 'minidump', containing the
-    binary-formatted minidump to symbolicate.
-
-    It is up to the caller to ensure that the symbols they want are currently
-    staged.
-
-    Args:
-      minidump: The binary minidump file to symbolicate.
-    """
-    to_return = ''
-    with tempfile.NamedTemporaryFile() as local:
-      while True:
-        data = minidump.file.read(8192)
-        if not data:
-          break
-        local.write(data)
-      local.flush()
-      stackwalk = subprocess.Popen(['minidump_stackwalk',
-                                    local.name,
-                                    updater.static_dir + '/debug/breakpad'],
-                                   stdout=subprocess.PIPE,
-                                   stderr=subprocess.PIPE)
-      to_return, error_text = stackwalk.communicate()
-      if stackwalk.returncode != 0:
-        raise DevServerError("Can't generate stack trace: %s (rc=%d)" % (
-            error_text, stackwalk.returncode))
-
-    return to_return
-
-  @cherrypy.expose
   def wait_for_status(self, **kwargs):
     """Waits for background artifacts to be downloaded from Google Storage.
 
diff --git a/devserver_util.py b/devserver_util.py
index e40ae7e..eb498f4 100644
--- a/devserver_util.py
+++ b/devserver_util.py
@@ -57,15 +57,12 @@
   return full_payload_url, nton_payload_url, mton_payload_url
 
 
-def GatherArtifactDownloads(main_staging_dir, archive_url, build, build_dir,
-                            static_dir):
+def GatherArtifactDownloads(main_staging_dir, archive_url, build, build_dir):
   """Generates artifacts that we mean to download and install for autotest.
 
   This method generates the list of artifacts we will need for autotest. These
-  artifacts are instances of downloadable_artifact.DownloadableArtifact.
-
-  Note, these artifacts can be downloaded asynchronously iff
-  !artifact.Synchronous().
+  artifacts are instances of downloadable_artifact.DownloadableArtifact.Note,
+  these artifacts can be downloaded asynchronously iff !artifact.Synchronous().
   """
   cmd = 'gsutil ls %s/*.bin' % archive_url
   msg = 'Failed to get a list of payloads.'
@@ -90,7 +87,6 @@
         mton_url, main_staging_dir, mton_payload))
 
   # Next we gather the miscellaneous payloads.
-  debug_url = archive_url + '/' + downloadable_artifact.DEBUG_SYMBOLS
   stateful_url = archive_url + '/' + downloadable_artifact.STATEFUL_UPDATE
   autotest_url = archive_url + '/' + downloadable_artifact.AUTOTEST_PACKAGE
   test_suites_url = (archive_url + '/' +
@@ -99,8 +95,6 @@
   stateful_payload = os.path.join(build_dir,
                                   downloadable_artifact.STATEFUL_UPDATE)
 
-  artifacts.append(downloadable_artifact.DebugTarball(
-      debug_url, main_staging_dir, static_dir))
   artifacts.append(downloadable_artifact.DownloadableArtifact(
       stateful_url, main_staging_dir, stateful_payload, synchronous=True))
   artifacts.append(downloadable_artifact.AutotestTarball(
diff --git a/devserver_util_unittest.py b/devserver_util_unittest.py
index f017208..15b41ff 100755
--- a/devserver_util_unittest.py
+++ b/devserver_util_unittest.py
@@ -286,8 +286,7 @@
                    ['p1', 'p2', 'p3'])
     expected_payloads = payloads + map(
         lambda x: '/'.join([archive_url_prefix, x]),
-            [downloadable_artifact.DEBUG_SYMBOLS,
-             downloadable_artifact.STATEFUL_UPDATE,
+            [downloadable_artifact.STATEFUL_UPDATE,
              downloadable_artifact.AUTOTEST_PACKAGE,
              downloadable_artifact.TEST_SUITES_PACKAGE])
     self.mox.StubOutWithMock(gsutil_util, 'GSUtilRun')
@@ -300,8 +299,7 @@
 
     self.mox.ReplayAll()
     artifacts = devserver_util.GatherArtifactDownloads(
-        self._static_dir, archive_url_prefix, build, self._install_dir,
-        self._static_dir)
+        self._static_dir, archive_url_prefix, build, self._install_dir)
     for index, artifact in enumerate(artifacts):
       self.assertEqual(artifact._gs_path, expected_payloads[index])
       self.assertTrue(artifact._tmp_staging_dir.startswith(self._static_dir))
@@ -319,8 +317,7 @@
                    ['p1', 'p2'])
     expected_payloads = payloads + map(
         lambda x: '/'.join([archive_url_prefix, x]),
-            [downloadable_artifact.DEBUG_SYMBOLS,
-             downloadable_artifact.STATEFUL_UPDATE,
+            [downloadable_artifact.STATEFUL_UPDATE,
              downloadable_artifact.AUTOTEST_PACKAGE,
              downloadable_artifact.TEST_SUITES_PACKAGE])
     self.mox.StubOutWithMock(gsutil_util, 'GSUtilRun')
@@ -334,8 +331,7 @@
 
     self.mox.ReplayAll()
     artifacts = devserver_util.GatherArtifactDownloads(
-        self._static_dir, archive_url_prefix, build, self._install_dir,
-        self._static_dir)
+        self._static_dir, archive_url_prefix, build, self._install_dir)
     for index, artifact in enumerate(artifacts):
       self.assertEqual(artifact._gs_path, expected_payloads[index])
       self.assertTrue(artifact._tmp_staging_dir.startswith(self._static_dir))
diff --git a/downloadable_artifact.py b/downloadable_artifact.py
index bf16885..f4a3f82 100644
--- a/downloadable_artifact.py
+++ b/downloadable_artifact.py
@@ -13,7 +13,6 @@
 
 
 # Names of artifacts we care about.
-DEBUG_SYMBOLS = 'debug.tgz'
 STATEFUL_UPDATE = 'stateful.tgz'
 TEST_IMAGE = 'chromiumos_test_image.bin'
 ROOT_UPDATE = 'update.gz'
@@ -138,17 +137,3 @@
     # code.
     cmd = 'cp %s/* %s' % (autotest_pkgs_dir, autotest_dir)
     subprocess.check_call(cmd, shell=True)
-
-
-class DebugTarball(Tarball):
-  """Wrapper around the debug symbols tarball to download from gsutil."""
-
-  def _ExtractTarball(self):
-    """Extracts debug/breakpad from the tarball into the install_path."""
-    cmd = 'tar xzf %s --directory=%s debug/breakpad' % (
-        self._tmp_stage_path, self._install_path)
-    msg = 'An error occurred when attempting to untar %s' % self._tmp_stage_path
-    try:
-      subprocess.check_call(cmd, shell=True)
-    except subprocess.CalledProcessError, e:
-      raise ArtifactDownloadError('%s %s' % (msg, e))
diff --git a/downloader.py b/downloader.py
index d0ef6e8..99988e1 100755
--- a/downloader.py
+++ b/downloader.py
@@ -75,8 +75,7 @@
       cherrypy.log('Gathering download requirements %s' % self._archive_url,
                    'DOWNLOAD')
       artifacts = devserver_util.GatherArtifactDownloads(
-          self._staging_dir, self._archive_url, short_build, self._build_dir,
-          self._static_dir)
+          self._staging_dir, self._archive_url, short_build, self._build_dir)
       devserver_util.PrepareBuildDirectory(self._build_dir)
 
       cherrypy.log('Downloading foreground artifacts from %s' % archive_url,
diff --git a/downloader_unittest.py b/downloader_unittest.py
index 51182ac..693689a 100755
--- a/downloader_unittest.py
+++ b/downloader_unittest.py
@@ -12,7 +12,7 @@
 import tempfile
 import unittest
 
-import downloadable_artifact
+import artifact_download
 import devserver
 import devserver_util
 import downloader
@@ -56,7 +56,7 @@
     artifacts = []
 
     for index in range(5):
-      artifact = self.mox.CreateMock(downloadable_artifact.DownloadableArtifact)
+      artifact = self.mox.CreateMock(artifact_download.DownloadableArtifact)
       # Make every other artifact synchronous.
       if index % 2 == 0:
         artifact.Synchronous = lambda: True
@@ -72,7 +72,7 @@
     tempfile.mkdtemp(suffix=mox.IgnoreArg()).AndReturn(self._work_dir)
     devserver_util.GatherArtifactDownloads(
         self._work_dir, self.archive_url_prefix, self.build,
-        self._work_dir, self._work_dir).AndReturn(artifacts)
+        self._work_dir).AndReturn(artifacts)
 
     for index, artifact in enumerate(artifacts):
       if index % 2 == 0: