Skip to content

Commit b54420d

Browse files
committed
bugzilla: Use bug.update_attachment API
Not RHBZ's old custom Flag.update. Public RHBZ supports update_attachment, which is supported by bugzilla 5+
1 parent 89b41cd commit b54420d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

bugzilla/base.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,16 +1510,16 @@ def updateattachmentflags(self, bugid, attachid, flagname, **kwargs):
15101510
status: new status for the flag ('-', '+', '?', 'X')
15111511
requestee: new requestee for the flag
15121512
'''
1513-
update = {
1514-
'name': flagname,
1515-
'attach_id': int(attachid),
1516-
}
1517-
update.update(kwargs.items())
1513+
# Bug ID was used for the original custom redhat API, no longer
1514+
# needed though
1515+
ignore = bugid
1516+
1517+
flags = {"name": flagname}
1518+
flags.update(kwargs)
1519+
update = {'ids': [int(attachid)], 'flags': [flags]}
15181520

1519-
result = self._proxy.Flag.update({
1520-
'ids': [int(bugid)],
1521-
'updates': [update]})
1522-
return result['flag_updates'][str(bugid)]
1521+
log.debug("Calling Bug.update_attachment(%s)", update)
1522+
return self._proxy.Bug.update_attachment(update)
15231523

15241524

15251525
#####################

0 commit comments

Comments
 (0)