summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Maas <opensource@till.name>2012-06-04 01:14:20 +0200
committerTill Maas <opensource@till.name>2012-06-04 01:14:20 +0200
commit656dc91b4943132bcef4d31731b5a42aa32615c0 (patch)
treecc801194f52862afc9b81eec2a3936a006cb9c39
parentc9b4c16d5b2575e32f3845776f50277165c009fe (diff)
downloadcnucnu-656dc91b4943132bcef4d31731b5a42aa32615c0.tar.gz
cnucnu-656dc91b4943132bcef4d31731b5a42aa32615c0.tar.xz
cnucnu-656dc91b4943132bcef4d31731b5a42aa32615c0.zip
bugzilla_reporter: Use logging module
-rw-r--r--cnucnu/bugzilla_reporter.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/cnucnu/bugzilla_reporter.py b/cnucnu/bugzilla_reporter.py
index bf3c046..9311a66 100644
--- a/cnucnu/bugzilla_reporter.py
+++ b/cnucnu/bugzilla_reporter.py
@@ -22,6 +22,7 @@ from config import global_config
from helper import filter_dict
import logging
+log = logging.getLogger('cnucnu.bugzilla_reporter')
class BugzillaReporter(object):
base_query = {'query_format': ['advanced'], 'emailreporter1': ['1'], 'emailtype1': ['exact']}
@@ -90,14 +91,14 @@ class BugzillaReporter(object):
update = {'summary': self.config["short_desc template"] % package,
'comment': self.config["description template"] % package
}
- print repr(update)
+ log.debug("About to update bug '%s' with '%r'" % (open_bug.bug_id, update))
res = self.bz._update_bug(open_bug.bug_id, update)
- print res
- print self.bug_url(open_bug)
+ log.debug("Result from bug update: %r" % res)
+ log.info("Updated bug: %s" % self.bug_url(open_bug))
return res
else:
bug = package.exact_outdated_bug
- print "bug already filed:%s %s" % (self.bug_url(bug), bug.bug_status)
+ log.info("already reported:%s %s" % (self.bug_url(bug), bug.bug_status))
def create_outdated_bug(self, package, dry_run=True):
@@ -109,12 +110,12 @@ class BugzillaReporter(object):
if not dry_run:
new_bug = self.bz.createbug(**bug_dict)
change_status = None
- print new_bug
- print self.bug_url(new_bug)
+ log.debug("Created new bug: %r" % new_bug)
+ log.info("Created bug: %s" % self.bug_url(new_bug))
if new_bug.bug_status != self.config['bug status']:
change_status = self.bz._proxy.bugzilla.changeStatus(new_bug.bug_id, self.config['bug status'], self.config['user'], "", "", False, False, 1)
- print "status changed", change_status
+ log.debug("Changed bug status %r" % change_status)
return (new_bug, change_status)
else:
return (bug_dict, None)