Backed out bug 1032978,r=Sylvestre
authorPeter Moore <pmoore@mozilla.com>
Fri, 22 Aug 2014 09:49:35 +0200
changeset 4850 bcfa18146bc7462ba2e64aef328a5dc9f92de015
parent 4849 93693c44cff6bad2fb39d6cd304a46be99eef11c
child 4851 dc2af4108a34ad44ca8adca5d841c2fc9e43155a
push id3575
push userpmoore@mozilla.com
push dateFri, 22 Aug 2014 07:50:37 +0000
reviewersSylvestre
bugs1032978
Backed out bug 1032978,r=Sylvestre
buildfarm/release/release-runner.py
lib/python/kickoff/api.py
setup.py
--- a/buildfarm/release/release-runner.py
+++ b/buildfarm/release/release-runner.py
@@ -1,16 +1,15 @@
 #!/usr/bin/env python
 
 import site
 import time
 import logging
 import sys
 import os
-import json
 from os import path
 from optparse import OptionParser
 from smtplib import SMTPException
 from functools import partial
 import textwrap
 from twisted.python.lockfile import FilesystemLock
 
 site.addsitedir(path.join(path.dirname(__file__), "../../lib/python"))
@@ -82,32 +81,31 @@ class ReleaseRunner(object):
     def update_status(self, release, status):
         log.info('updating status for %s to %s' % (release['name'], status))
         try:
             self.release_api.update(release['name'], status=status)
         except requests.HTTPError, e:
             log.warning('Caught HTTPError: %s' % e.response.content)
             log.warning('status update failed, continuing...', exc_info=True)
 
-    def start_release_automation(self, release, master, enUSPlatforms):
+    def start_release_automation(self, release, master):
         sendchange(
             release['branch'],
             getReleaseTag(getBaseTag(release['product'],
                                      release['version'])),
             release['submitter'],
             master,
             release['product']
         )
-        self.mark_as_completed(release, enUSPlatforms)
+        self.mark_as_completed(release)
 
-    def mark_as_completed(self, release, enUSPlatforms):
+    def mark_as_completed(self, release):
         log.info('mark as completed %s' % release['name'])
-        self.release_api.update(release['name'], complete=True, 
-                                status='Started', 
-                                enUSPlatforms=json.dumps(enUSPlatforms))
+        self.release_api.update(
+            release['name'], complete=True, status='Started')
 
     def mark_as_failed(self, release, why):
         log.info('mark as failed %s' % release['name'])
         self.release_api.update(release['name'], ready=False, status=why)
 
 
 def getPartials(release):
     partials = {}
@@ -417,21 +415,17 @@ def main(options):
         for release in rr.new_releases:
             rr.mark_as_failed(release, 'Failed: %s' % repr(e))
         raise
 
     rc = 0
     for release in rr.new_releases:
         try:
             rr.update_status(release, 'Running sendchange command')
-            cfgFile = getReleaseConfigName(
-                release['product'], path.basename(release['branch']),
-                release['version'], staging)
-            enUSPlatforms = readReleaseConfig(cfgFile)['enUSPlatforms']
-            rr.start_release_automation(release, sendchange_master, enUSPlatforms)
+            rr.start_release_automation(release, sendchange_master)
         except:
             # We explicitly do not raise an error here because there's no
             # reason not to start other releases if the sendchange fails for
             # another one. We _do_ need to set this in order to exit
             # with the right code, though.
             rc = 2
             rr.update_status(release, 'Sendchange failed')
             log.error('Sendchange failed for %s: ' % release, exc_info=True)
--- a/lib/python/kickoff/api.py
+++ b/lib/python/kickoff/api.py
@@ -46,27 +46,24 @@ class API(object):
                     config=self.config, timeout=self.timeout,
                     auth=self.auth)
                 self.csrf_token = res.headers['X-CSRF-Token']
             data['csrf_token'] = self.csrf_token
         log.debug('Request to %s' % url)
         log.debug('Data sent: %s' % data)
         try:
             return retry(self.session.request, sleeptime=5, max_sleeptime=15,
-                         retry_exceptions=(requests.HTTPError, 
-                                           requests.ConnectionError),
+                         retry_exceptions=(requests.HTTPError, requests.ConnectionError),
                          attempts=self.retries,
                          kwargs=dict(method=method, url=url, data=data,
                                      config=self.config, timeout=self.timeout,
                                      auth=self.auth, params=params)
-                        )
+            )
         except requests.HTTPError, e:
-            log.error('Caught HTTPError: %d %s' % 
-                     (e.response.status_code, e.response.content), 
-                     exc_info=True)
+            log.error('Caught HTTPError: %d %s' % (e.response.status_code, e.response.content), exc_info=True)
             raise
 
 
 class Releases(API):
     url_template = '/releases'
 
     def getReleases(self, ready=1, complete=0):
         resp = None
@@ -93,25 +90,16 @@ class Release(API):
             log.error('Caught error while getting release', exc_info=True)
             if resp:
                 log.error(resp.content)
                 log.error('Response code: %d' % resp.status_code)
             raise
 
     def update(self, name, **data):
         url_template_vars = {'name': name}
-        return self.request(method='POST', data=data, 
-                            url_template_vars=url_template_vars).content
+        return self.request(method='POST', data=data, url_template_vars=url_template_vars).content
 
 
 class ReleaseL10n(API):
     url_template = '/releases/%(name)s/l10n'
 
     def getL10n(self, name):
         return self.request(url_template_vars={'name': name}).content
-
-
-class Status(API):
-    url_template = '/releases/%(name)s/status'
-
-    def update(self, name, data):
-        return self.request(method='POST', data=data,
-                            url_template_vars={'name': name}).content
--- a/setup.py
+++ b/setup.py
@@ -20,17 +20,16 @@ setup(
     install_requires=[
         'sqlalchemy',
         'argparse',
         'twisted',
         'simplejson',
         'furl',
         'requests',
         'docopt',
-        'python-dateutil',
     ],
 
     entry_points={
         'console_scripts': [
             'slavealloc = slavealloc.scripts.main:main'
         ],
     },