From cebd85d8015171e2a320ab5b1ca0a912321918de Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Sun, 19 Aug 2012 02:44:44 +0200 Subject: [PATCH] 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: Iustin Pop <iustin@google.com> Reviewed-by: Agata Murawska <agatamurawska@google.com> --- lib/rapi/rlib2.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/rapi/rlib2.py b/lib/rapi/rlib2.py index e434340b7..addb938c1 100644 --- a/lib/rapi/rlib2.py +++ b/lib/rapi/rlib2.py @@ -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 -- GitLab