~matsubara/tarmac/test-fail-staging

« back to all changes in this revision

Viewing changes to tarmac/plugins/recipebuilder.py

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2010-11-03 19:18:03 UTC
  • mfrom: (380.1.1 recipe-httperrors)
  • Revision ID: tarmac-20101103191803-79un6v1qnqa99xl7
Trap ResponseError exceptions when requesting recipe builds

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with Tarmac.  If not, see <http://www.gnu.org/licenses/>.
16
16
'''Tarmac plug-in for triggering package recipe builds on Launchpad.'''
 
17
from lazr.restfulclient.errors import ResponseError
17
18
from tarmac.hooks import tarmac_hooks
18
19
from tarmac.plugins import TarmacPlugin
19
20
 
48
49
                                       pocket=u'Release')
49
50
        except (KeyError, ValueError, AttributeError):
50
51
            self.logger.error('Recipe not found: %s' % self.package_recipe)
51
 
            return
52
 
 
 
52
        except ResponseError, error:
 
53
            self.logger.error('Failed to request build of recipe: %s: (%s) %s',
 
54
                              self.package_recipe,
 
55
                              error.response.status, error.response.reason)
53
56
 
54
57
tarmac_hooks['tarmac_post_merge'].hook(PackageRecipe(),
55
58
                                       'Package recipe builder plug-in.')