[PATCH] Update the data package for setting bug depdendencies. Added support for the 'set' command.

Bryan Kearney bkearney at redhat.com
Mon Oct 29 15:17:21 UTC 2012


---
 bugzilla/rhbugzilla.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/bugzilla/rhbugzilla.py b/bugzilla/rhbugzilla.py
index b3ec9de..6b50321 100644
--- a/bugzilla/rhbugzilla.py
+++ b/bugzilla/rhbugzilla.py
@@ -298,10 +298,15 @@ class RHBugzilla(Bugzilla4):
         blocked, dependson: list of bug ids/aliases
         action: 'add' or 'delete'
         '''
-        if action not in ('add','delete'):
-            raise ValueError, "action must be 'add' or 'delete'"
-        update={'%s_blocked' % action: blocked,
-                '%s_dependson' % action: dependson}
+        if action not in ('add','delete', 'set'):
+            raise ValueError, "action must be 'add', 'set', or 'delete'"
+
+        # change the action to be remove if it is delete
+        if action == 'delete':
+            action = 'remove'
+
+        update={'blocks' : {action : blocked},
+                'depends_on' : {action: dependson}}
         self._update_bug(id,update)
 
     def _updatecc(self,id,cclist,action,comment='',nomail=False):
-- 
1.7.11.7


--------------090203000105000709050708--


More information about the python-bugzilla mailing list