From 642464388b1c03d09b1c1ff8401e0f0300319542 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Tue, 13 Oct 2009 14:01:20 +0200
Subject: [PATCH] rapi: fix tag operations

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 | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/rapi/baserlib.py b/lib/rapi/baserlib.py
index 1ed974bb0..30d9cbfcb 100644
--- a/lib/rapi/baserlib.py
+++ b/lib/rapi/baserlib.py
@@ -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):
-- 
GitLab