From bf2ace9f096c057e80e80aa34ed4ecc78ad14033 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Wed, 15 Sep 2010 21:37:38 +0200
Subject: [PATCH] =?UTF-8?q?cmdlib:=20Fix=20type=20of=20=E2=80=9Cname?=
 =?UTF-8?q?=E2=80=9D=20parameter=20for=20tag=20operations?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The parameter β€œname” is be None for cluster tags.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/cmdlib.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index b45389309..deee80e0e 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -9739,7 +9739,8 @@ class LUGetTags(TagsLU):
   """
   _OP_PARAMS = [
     ("kind", _NoDefault, _TElemOf(constants.VALID_TAG_TYPES)),
-    ("name", _NoDefault, _TNonEmptyString),
+    # Name is only meaningful for nodes and instances
+    ("name", _NoDefault, _TMaybeString),
     ]
   REQ_BGL = False
 
@@ -9798,7 +9799,8 @@ class LUAddTags(TagsLU):
   """
   _OP_PARAMS = [
     ("kind", _NoDefault, _TElemOf(constants.VALID_TAG_TYPES)),
-    ("name", _NoDefault, _TNonEmptyString),
+    # Name is only meaningful for nodes and instances
+    ("name", _NoDefault, _TMaybeString),
     ("tags", _NoDefault, _TListOf(_TNonEmptyString)),
     ]
   REQ_BGL = False
@@ -9831,7 +9833,8 @@ class LUDelTags(TagsLU):
   """
   _OP_PARAMS = [
     ("kind", _NoDefault, _TElemOf(constants.VALID_TAG_TYPES)),
-    ("name", _NoDefault, _TNonEmptyString),
+    # Name is only meaningful for nodes and instances
+    ("name", _NoDefault, _TMaybeString),
     ("tags", _NoDefault, _TListOf(_TNonEmptyString)),
     ]
   REQ_BGL = False
-- 
GitLab