summaryrefslogtreecommitdiffstats
path: root/scripts/makebumpver
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2012-09-20 15:17:13 -0700
committerBrian C. Lane <bcl@redhat.com>2012-09-25 15:21:06 -0700
commit61fe9b516888f0f986f626a0479713db330082b0 (patch)
treee78a42ce04cf2ac42ad1aeeb32d3f193ff960e9a /scripts/makebumpver
parent7f71f5f761d97b75b62ed0873f6fb7f98a24d3f5 (diff)
downloadanaconda-61fe9b516888f0f986f626a0479713db330082b0.tar.gz
anaconda-61fe9b516888f0f986f626a0479713db330082b0.tar.xz
anaconda-61fe9b516888f0f986f626a0479713db330082b0.zip
Add debug option to bumpver
Pass -d to bumpver to turn on debug logging or run: BZDEBUG=1 make bumpver
Diffstat (limited to 'scripts/makebumpver')
-rwxr-xr-xscripts/makebumpver17
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/makebumpver b/scripts/makebumpver
index e497fea9d..9fe577c3d 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -20,6 +20,11 @@
#
# Author: David Cantrell <dcantrell@redhat.com>
+import logging
+logging.basicConfig(level=logging.DEBUG)
+log = logging.getLogger("bugzilla")
+log.setLevel(logging.INFO)
+
import bugzilla
import datetime
import getopt
@@ -32,6 +37,7 @@ import textwrap
class MakeBumpVer:
def __init__(self, *args, **kwargs):
+ log.debug("%s" % (kwargs,))
self.bzserver = 'bugzilla.redhat.com'
self.bzurl = "https://%s/xmlrpc.cgi" % self.bzserver
self.username = None
@@ -134,9 +140,11 @@ class MakeBumpVer:
print
if not self.bz.logged_in:
- self.bz.login(self.username, self.password)
+ rc = self.bz.login(self.username, self.password)
+ log.debug("login rc = %s" % (rc,))
bugs = self.bz.query({'bug_id': bug})
+ log.debug("bugs = %s" % (bugs))
if len(bugs) != 1:
return None
@@ -372,6 +380,7 @@ def usage(cmd):
sys.stdout.write(" -b, --bugreport Bug reporting email address.\n")
sys.stdout.write(" -i, --ignore Comma separated list of git commits to ignore.\n")
sys.stdout.write(" -m, --map Comma separated list of FEDORA_BZ=RHEL_BZ mappings.\n")
+ sys.stdout.write(" -d, --debug Turn on debug logging to stdout\n")
sys.stdout.write("\nThe -i switch is intended for use with utility commits that we do not need to\n")
sys.stdout.write("reference in the spec file changelog. The -m switch is used to map a Fedora\n")
sys.stdout.write("BZ number to a RHEL BZ number for the spec file changelog. Use -m if you have\n")
@@ -389,10 +398,10 @@ def main(argv):
opts, args = [], []
try:
- opts, args = getopt.getopt(sys.argv[1:], 'n:v:r:b:i:m:?',
+ opts, args = getopt.getopt(sys.argv[1:], 'n:v:r:b:i:m:d?',
['name=', 'version=', 'release=',
'bugreport=', 'ignore=', 'map=',
- 'help'])
+ 'debug', 'help'])
except getopt.GetoptError:
help = True
@@ -409,6 +418,8 @@ def main(argv):
ignore = a
elif o in ('-m', '--map'):
bugmap = a
+ elif o in ('-d', '--debug'):
+ log.setLevel(logging.DEBUG)
elif o in ('-?', '--help'):
help = True
else: