Skip to content

Commit 087a6c6

Browse files
committed
bugzilla: Privatize getbug_extra_fields
1 parent 74cb2a3 commit 087a6c6

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

bugzilla/base.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,8 @@ def _find_comps():
829829
#
830830
# As of Dec 2012 it seems like only RH bugzilla actually has behavior
831831
# like this, for upstream bz it returns all info for every Bug.get()
832-
getbug_extra_fields = []
833-
832+
_getbug_extra_fields = []
833+
_supports_getbug_extra_fields = False
834834

835835
def _getbugs(self, idlist, simple=False, permissive=True,
836836
extra_fields=None):
@@ -849,14 +849,15 @@ def _getbugs(self, idlist, simple=False, permissive=True,
849849
# String aliases can be passed as well
850850
idlist.append(i)
851851

852+
extra_fields = self._listify(extra_fields or [])
853+
if not simple:
854+
extra_fields += self._getbug_extra_fields
855+
852856
getbugdata = {"ids": idlist}
853857
if permissive:
854858
getbugdata["permissive"] = 1
855-
if self.getbug_extra_fields and not simple:
856-
# This means bugzilla actually supports extra_fields
857-
getbugdata["extra_fields"] = self.getbug_extra_fields
858-
if extra_fields:
859-
getbugdata["extra_fields"] += extra_fields
859+
if self._supports_getbug_extra_fields:
860+
getbugdata["extra_fields"] = extra_fields
860861

861862
log.debug("Calling Bug.get_bugs with: %s", getbugdata)
862863
r = self._proxy.Bug.get_bugs(getbugdata)

bugzilla/rhbugzilla.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,12 @@ def _add_both_alias(newname, origname):
6262
# flags format isn't exactly the same but it's the closest approx
6363
self._add_field_alias('flags', 'flag_types')
6464

65-
66-
getbug_extra_fields = (
67-
_parent.getbug_extra_fields + [
65+
self._getbug_extra_fields += [
6866
"comments", "description",
6967
"external_bugs", "flags", "sub_components",
7068
"tags",
7169
]
72-
)
70+
self._supports_getbug_extra_fields = True
7371

7472

7573
######################

0 commit comments

Comments
 (0)