Skip to content

Commit 78fd831

Browse files
committed
rhbugzilla: Drop deprecated rhbz_back_compat, multicall
rhbz_back_compat has thrown a warning for 2 years, I think we can safely drop it
1 parent d2690d9 commit 78fd831

3 files changed

Lines changed: 0 additions & 80 deletions

File tree

bugzilla/rhbugzilla.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,6 @@ class RHBugzilla(_parent):
3333
'''
3434

3535
def __init__(self, *args, **kwargs):
36-
"""
37-
@rhbz_back_compat: If True, convert parameters to the format they were
38-
in prior RHBZ upgrade in June 2012. Mostly this replaces lists
39-
with comma separated strings, and alters groups and flags.
40-
Default is False. Please don't use this in new code, just update
41-
your scripts.
42-
@multicall: Unused nowadays, will be removed in the future
43-
"""
44-
# 'multicall' is no longer used, just ignore it
45-
multicall = kwargs.pop("multicall", None)
46-
self.rhbz_back_compat = bool(kwargs.pop("rhbz_back_compat", False))
47-
48-
if multicall is not None:
49-
log.warn("multicall is unused and will be removed in a "
50-
"future release.")
51-
52-
if self.rhbz_back_compat:
53-
log.warn("rhbz_back_compat will be removed in a future release.")
54-
5536
_parent.__init__(self, *args, **kwargs)
5637

5738
def _add_both_alias(newname, origname):
@@ -325,43 +306,6 @@ def post_translation(self, query, bug):
325306
values += vallist
326307
bug['sub_component'] = " ".join(values)
327308

328-
if not self.rhbz_back_compat:
329-
return
330-
331-
if 'flags' in bug and isinstance(bug["flags"], list):
332-
tmpstr = []
333-
for tmp in bug['flags']:
334-
tmpstr.append("%s%s" % (tmp['name'], tmp['status']))
335-
336-
bug['flags'] = ",".join(tmpstr)
337-
338-
if 'blocks' in bug and isinstance(bug["blocks"], list):
339-
# Aliases will handle the 'blockedby' and 'blocked' back compat
340-
bug['blocks'] = ','.join([str(b) for b in bug['blocks']])
341-
342-
if 'keywords' in bug and isinstance(bug["keywords"], list):
343-
bug['keywords'] = ','.join(bug['keywords'])
344-
345-
if 'alias' in bug and isinstance(bug["alias"], list):
346-
bug['alias'] = ','.join(bug['alias'])
347-
348-
if ('groups' in bug and
349-
isinstance(bug["groups"], list) and
350-
len(bug["groups"]) > 0 and
351-
isinstance(bug["groups"][0], str)):
352-
# groups went to the opposite direction: it got simpler
353-
# instead of having name, ison, description, it's now just
354-
# an array of strings of the groups the bug belongs to
355-
# we're emulating the old behaviour here
356-
tmp = []
357-
for g in bug['groups']:
358-
t = {}
359-
t['name'] = g
360-
t['description'] = g
361-
t['ison'] = 1
362-
tmp.append(t)
363-
bug['groups'] = tmp
364-
365309
def build_external_tracker_boolean_query(
366310
self, ext_type_description=None, ext_type_url=None,
367311
ext_bz_bug_id=None, ext_status=None):

tests/misc.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -178,25 +178,5 @@ def _testPostCompare(bz, indict, outexpect):
178178
out_simple["versions"] = out_simple["version"]
179179
out_simple["version"] = out_simple["versions"][0]
180180

181-
out_complex = out_simple.copy()
182-
out_complex["keywords"] = ",".join(out_complex["keywords"])
183-
out_complex["blocks"] = ",".join([str(b) for b in
184-
out_complex["blocks"]])
185-
out_complex["alias"] = ",".join(out_complex["alias"])
186-
out_complex["groups"] = [{'description': 'redhat',
187-
'ison': 1, 'name': 'redhat'}]
188-
out_complex["flags"] = "qe_test_coverage?,rhel-6.4.0+"
189-
190181
_testPostCompare(bug3, test1, test1)
191182
_testPostCompare(rhbz, test1, out_simple)
192-
193-
rhbz.rhbz_back_compat = True
194-
_testPostCompare(rhbz, test1, out_complex)
195-
196-
def testRHBZInit(self):
197-
# Just get us coverage when the extra values are specified
198-
level = bugzilla.log.level
199-
bugzilla.log.setLevel(logging.ERROR)
200-
bugzilla.RHBugzilla(None, cookiefile=None, multicall=True,
201-
rhbz_back_compat=True)
202-
bugzilla.log.setLevel(level)

tests/query.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,3 @@ def testStandardQuery(self):
310310
'order': 'bug_status,bug_id'
311311
}
312312
self._check(url, query)
313-
314-
def testBZAutoMagic(self):
315-
bz = bugzilla.Bugzilla("bugzilla.redhat.com")
316-
self.assertTrue(hasattr(bz, "rhbz_back_compat"))

0 commit comments

Comments
 (0)