From 4d17512ae8329a209bed8c642c70744bcda45ae0 Mon Sep 17 00:00:00 2001 From: Alex Legler Date: Wed, 1 Jun 2016 16:53:09 +0200 Subject: Add GLSAMAKER_BUGZIE_SKIP to skip bugzilla operations --- config/initializers/glsamaker.rb.sample | 1 + lib/bugzilla.rb | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/config/initializers/glsamaker.rb.sample b/config/initializers/glsamaker.rb.sample index a2fb4a2..7282279 100644 --- a/config/initializers/glsamaker.rb.sample +++ b/config/initializers/glsamaker.rb.sample @@ -32,6 +32,7 @@ GLSAMAKER_HOST = "localhost:3000" GLSAMAKER_PORTDIR = "/usr/portage/" # Bugzilla login info +GLSAMAKER_BUGZIE_SKIP = false GLSAMAKER_BUGZIE_HOST = 'bugs.gentoo.org' GLSAMAKER_BUGZIE_USER = nil GLSAMAKER_BUGZIE_PW = nil diff --git a/lib/bugzilla.rb b/lib/bugzilla.rb index b35c5a8..d9b8c44 100644 --- a/lib/bugzilla.rb +++ b/lib/bugzilla.rb @@ -23,6 +23,11 @@ module Bugzilla module_function # Adds a comment to a bug. Returns the comment id on success, raises an exception on failure. def add_comment(bug, comment) + if GLSAMAKER_BUGZIE_SKIP + Rails.logger.info 'Skipped Bugzilla.add_comment' + return + end + Rails.logger.debug 'Called Bugzilla.add_comment' did_retry = false @@ -55,6 +60,11 @@ module Bugzilla # Updates a bug. Returns an array of changes that were done on the bug. def update_bug(bug, changes = {}) + if GLSAMAKER_BUGZIE_SKIP + Rails.logger.info 'Skipped Bugzilla.update_bug' + return + end + Rails.logger.debug 'Called Bugzilla.update_bug' did_retry = false @@ -100,6 +110,11 @@ module Bugzilla # Files a bug, and returns the id of the filed bug def file_bug(data) + if GLSAMAKER_BUGZIE_SKIP + Rails.logger.info 'Skipped Bugzilla.file_bug' + return + end + Rails.logger.debug 'Called Bugzilla.file_bug' did_retry = false -- cgit v1.2.3