[PATCH] Add flags_requestee as an outputformat specifier
by Lon Hohberger
Some bugzilla instances (like Red Hat's) allow for
flags to have a requestee - the most common is the
'needinfo' flag. It's helpful to know who the bug
needs information from, so this allows providing
that information without breaking the existing output
format.
Resubmit based on feedback from Cole Robinson.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
bin/bugzilla | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/bin/bugzilla b/bin/bugzilla
index 0ded73e..73fe5dd 100755
--- a/bin/bugzilla
+++ b/bin/bugzilla
@@ -762,9 +762,14 @@ def _format_output(bz, opt, buglist):
if fieldname == "flag" and rest:
val = b.get_flag_status(rest)
- elif fieldname == "flags":
- val = ",".join([f["name"] + f["status"]
- for f in getattr(b, "flags", [])])
+ elif fieldname == "flags" or fieldname == "flags_requestee":
+ tmpstr = []
+ for f in getattr(b, "flags", []):
+ requestee = f.get('requestee', "");
+ if fieldname == "flags":
+ requestee = ""
+ tmpstr.append("%s%s%s" % (f['name'], f['status'], requestee))
+ val = ",".join(tmpstr)
elif fieldname == "cve":
cves = []
--
1.8.4.2
10 years, 3 months
[PATCH] Add flags_requestee as an outputformat specifier
by Lon Hohberger
Some bugzilla instances (like Red Hat's) allow for
flags to have a requestee - the most common is the
'needinfo' flag. It's helpful to know who the bug
needs information from, so this allows providing
that information without breaking the existing output
format.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
bin/bugzilla | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/bin/bugzilla b/bin/bugzilla
index 0ded73e..65c1f48 100755
--- a/bin/bugzilla
+++ b/bin/bugzilla
@@ -766,6 +766,16 @@ def _format_output(bz, opt, buglist):
val = ",".join([f["name"] + f["status"]
for f in getattr(b, "flags", [])])
+ elif fieldname == "flags_requestee":
+ tmpstr = []
+ for f in getattr(b, "flags", []):
+ try:
+ tmpstr.append("%s%s%s" %
+ (f['name'], f['status'], f['requestee']))
+ except KeyError:
+ tmpstr.append("%s%s" % (f['name'], f['status']))
+ val = ",".join(tmpstr)
+
elif fieldname == "cve":
cves = []
for key in getattr(b, "keywords", []):
--
1.8.4.2
10 years, 3 months
[PATCH 1/3] Add a Keywords, assigned_to, qa_contact to 'new'
by Lon Hohberger
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
bin/bugzilla | 10 ++++++++++
bugzilla/base.py | 7 ++++++-
bugzilla/rhbugzilla.py | 2 +-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/bin/bugzilla b/bin/bugzilla
index 30a1b13..0ded73e 100755
--- a/bin/bugzilla
+++ b/bin/bugzilla
@@ -154,6 +154,13 @@ def setup_action_parser(action):
p.add_option('--groups',
metavar='GROUP[, GROUP, ...]', action="append",
help="add groups to which bug is visible")
+ p.add_option('--assigned_to',
+ help='Assign bugzilla to specified email address')
+ p.add_option('--qa_contact',
+ help='Set QA contact to specified email address')
+ p.add_option('--keywords',
+ metavar='KEYWORD[, KEYWORD, ...]', action="append",
+ help="Set specified keywords on new bugzilla")
elif action == 'query':
p.set_description("List bug reports that match the given criteria.")
@@ -836,6 +843,7 @@ def _do_new(bz, opt):
depends_on=parse_multi(opt.dependson) or None,
description=opt.description or None,
groups=parse_multi(opt.groups) or None,
+ keywords=parse_multi(opt.keywords) or None,
op_sys=opt.os or None,
platform=opt.arch or None,
priority=opt.priority or None,
@@ -844,6 +852,8 @@ def _do_new(bz, opt):
summary=opt.summary or None,
url=opt.url or None,
version=opt.version or None,
+ assigned_to=opt.assigned_to or None,
+ qa_contact=opt.qa_contact or None,
)
if opt.test_return_result:
diff --git a/bugzilla/base.py b/bugzilla/base.py
index 3a5d65d..b1258e7 100644
--- a/bugzilla/base.py
+++ b/bugzilla/base.py
@@ -1304,6 +1304,8 @@ class BugzillaBase(object):
comment_private=None,
blocks=None,
cc=None,
+ assigned_to=None,
+ keywords=None,
depends_on=None,
groups=None,
op_sys=None,
@@ -1326,6 +1328,8 @@ class BugzillaBase(object):
localdict["depends_on"] = self._listify(depends_on)
if groups:
localdict["groups"] = self._listify(groups)
+ if keywords:
+ localdict["keywords"] = self._listify(keywords)
if description:
localdict["description"] = description
if comment_private:
@@ -1338,7 +1342,8 @@ class BugzillaBase(object):
platform=platform, priority=priority, qa_contact=qa_contact,
resolution=resolution, severity=severity, status=status,
target_milestone=target_milestone,
- target_release=target_release, url=url)
+ target_release=target_release, url=url,
+ assigned_to=assigned_to)
ret.update(localdict)
return ret
diff --git a/bugzilla/rhbugzilla.py b/bugzilla/rhbugzilla.py
index 6eda791..399ecb0 100644
--- a/bugzilla/rhbugzilla.py
+++ b/bugzilla/rhbugzilla.py
@@ -54,7 +54,7 @@ class RHBugzilla(_parent):
getbug_extra_fields = (
_parent.getbug_extra_fields + [
"attachments", "comments", "description",
- "external_bugs", "flags",
+ "external_bugs", "flags"
]
)
--
1.8.4.2
10 years, 3 months
[PATCH] Add travis-ci configuration.
by Arun Babu Neelicattu
From: Arun Babu Neelicattu <abn(a)redhat.com>
---
.travis.yml | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 .travis.yml
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..6f8ca4a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,8 @@
+language: python
+install:
+ - pip install tox
+script:
+ - tox -- --ro-functional
+branches:
+notifications:
+ email: false
--
1.8.1.4
10 years, 3 months
[PATCH] Add requirement files to manifest template
by Arun Babu Neelicattu
From: Arun Babu Neelicattu <abn(a)redhat.com>
---
MANIFEST.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/MANIFEST.in b/MANIFEST.in
index 0b9da23..23fc6b4 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -2,4 +2,5 @@ include COPYING HACKING MANIFEST.in README
include bugzilla.1
include bz-api-notes.txt
include python-bugzilla.spec
+include *requirements.txt
recursive-include tests *.py *.txt
--
1.8.3.1
10 years, 3 months
how to get all bug informations with all comments from other users
by thomas heidkamp
perhaps this is a stupid questionI am connnection to our bugzilla box with following code.
---import bugzilla as bugtickit_user = "xx(a)test.de"pw = "test"ticketNR=438557b3 = bug.Bugzilla3(url="https://tick.XXXXXXXX.com/xmlrpc.cgi")b3.login(user=tickit_user,password=pw)tick = b3.getbug(ticketNR)prio = tick.priorityreporterid = tick.reporter_idresolution = tick.resolutionstatus = tick.statussummary = tick.summaryversion = tick.versionseverity = tick.severityteam = tick.cf_team_raisedresolveremail = tick.cf_resolveruseragent = tick.bugzilla.user_agentcomponent_id= tick.component_idreporter_id= tick.reporter_id print prioprint reporteridprint resolutionprint statusprint summaryprint versionprint teamprint resolveremailprint useragent
---
But how to get all the other comments etc from the bug ? There are many more .
when I execute the
https://tick.XXXXXXXX.com/show_bug.cgi?id=438557 in browser
I see a lot of more infos about all comments / bugs / etc.
How to get all the comments from the other users in bugzilla related to this ticketNR ?
thanks.
thomas
10 years, 3 months
[PATCH 1/2] Skip tests if virtual environment is not active
by Arun Babu Neelicattu
From: Arun Babu Neelicattu <abn(a)redhat.com>
---
contrib/run-tests | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/contrib/run-tests b/contrib/run-tests
index d9e34ce..285184e 100755
--- a/contrib/run-tests
+++ b/contrib/run-tests
@@ -11,10 +11,15 @@ ARGS="$@"
for BIN in python2 python3; do
if command -v ${BIN} >/dev/null 2>&1; then
- echo "INFO: Running tests for ${BIN}"
+ echo "INFO: Activating environment for ${BIN}"
. ./contrib/activate-dev-env ${BIN}
- python setup.py test ${ARGS}
- echo "INFO: Tests completed for ${BIN}"
+ if [ -z ${VIRTUAL_ENV} ]; then
+ echo "WARN: Virtual Environment not active, skipping tests."
+ else
+ echo "INFO: Running tests for ${BIN}"
+ python setup.py test ${ARGS}
+ echo "INFO: Tests completed for ${BIN}"
+ fi
else
echo "INFO: ${BIN} not found, skipping tests."
fi
--
1.8.1.4
10 years, 3 months
[PATCH 1/3] Add tox configuration
by Arun Babu Neelicattu
From: Arun Babu Neelicattu <abn(a)redhat.com>
---
tox.ini | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 tox.ini
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..3025714
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,9 @@
+[tox]
+envlist = py27,py33
+
+[testenv]
+deps=
+ -rrequirements.txt
+ -rtest-requirements.txt
+commands=
+ python setup.py test []
--
1.8.3.1
10 years, 3 months