rapi: fix tag operations
authorIustin Pop <iustin@google.com>
Tue, 13 Oct 2009 12:01:20 +0000 (14:01 +0200)
committerIustin Pop <iustin@google.com>
Tue, 13 Oct 2009 12:03:39 +0000 (14:03 +0200)
This patch fixes the tag PUT/DELETE operations, and additionally changes
the _Tags_* functions to take only positional and not keyword arguments
(the defaults do not make any sense at all, and they are always called
with all arguments).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/rapi/baserlib.py

index 1ed974b..30d9cbf 100644 (file)
@@ -80,7 +80,7 @@ def MapFields(names, data):
   return dict(zip(names, data))
 
 
-def _Tags_GET(kind, name=""):
+def _Tags_GET(kind, name):
   """Helper function to retrieve tags.
 
   """
@@ -103,18 +103,20 @@ def _Tags_GET(kind, name=""):
   return list(tags)
 
 
-def _Tags_PUT(kind, tags, name=""):
+def _Tags_PUT(kind, tags, name, dry_run):
   """Helper function to set tags.
 
   """
-  return SubmitJob([opcodes.OpAddTags(kind=kind, name=name, tags=tags)])
+  return SubmitJob([opcodes.OpAddTags(kind=kind, name=name,
+                                      tags=tags, dry_run=dry_run)])
 
 
-def _Tags_DELETE(kind, tags, name=""):
+def _Tags_DELETE(kind, tags, name, dry_run):
   """Helper function to delete tags.
 
   """
-  return SubmitJob([opcodes.OpDelTags(kind=kind, name=name, tags=tags)])
+  return SubmitJob([opcodes.OpDelTags(kind=kind, name=name,
+                                      tags=tags, dry_run=dry_run)])
 
 
 def MapBulkFields(itemslist, fields):