Commit cebd85d8 authored by Iustin Pop's avatar Iustin Pop
Browse files

Switch RAPI to use same tags listing as CLI



Currently, RAPI uses queries (as in QueryNode with field tags) for
getting the tags, whereas the CLI uses the QueryTags Luxi
command. Since this discrepancy is not good, let's switch RAPI to use
the same method as the CLI.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
parent 4cd428db
......@@ -1340,16 +1340,7 @@ class _R_Tags(baserlib.OpcodeResource):
raise http.HttpBadRequest("Missing name on tag request")
cl = self.GetClient()
if kind == constants.TAG_INSTANCE:
fn = cl.QueryInstances
elif kind == constants.TAG_NODEGROUP:
fn = cl.QueryGroups
else:
fn = cl.QueryNodes
result = fn(names=[self.name], fields=["tags"], use_locking=False)
if not result or not result[0]:
raise http.HttpBadGateway("Invalid response from tag query")
tags = result[0][0]
tags = list(cl.QueryTags(kind, self.name))
elif kind == constants.TAG_CLUSTER:
assert not self.name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment