This change is mostly cosmetic. Previously, the literal "cluster" was
used for the 'name' field of tag operations on the cluster (as opposed
to a node or an instance). Since this field has a type of TMaybeString
specifically for the case of the cluster, it seems more correct to use
None, rather than an arbitrary string (that is not used by the callee).
Additionally: note in opcodes.py that groups also expect a name; the
previous comment only referred to nodes and instances.
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
raise errors.ProgrammerError("tag_type not passed to _ExtractTagsObject")
kind = opts.tag_type
if kind == constants.TAG_CLUSTER:
- retval = kind, kind
+ retval = kind, None
elif kind in (constants.TAG_NODEGROUP,
constants.TAG_NODE,
constants.TAG_INSTANCE):
OP_PARAMS = [
_PTagKind,
_PTags,
- # Name is only meaningful for nodes and instances
+ # Name is only meaningful for groups, nodes and instances
("name", ht.NoDefault, ht.TMaybeString,
"Name of object where tag(s) should be added"),
]
OP_PARAMS = [
_PTagKind,
_PTags,
- # Name is only meaningful for nodes and instances
+ # Name is only meaningful for groups, nodes and instances
("name", ht.NoDefault, ht.TMaybeString,
"Name of object where tag(s) should be deleted"),
]