Revision 414ebaf1 lib/rapi/baserlib.py
b/lib/rapi/baserlib.py | ||
---|---|---|
92 | 92 |
"""Helper function to retrieve tags. |
93 | 93 |
|
94 | 94 |
""" |
95 |
if kind == constants.TAG_INSTANCE or kind == constants.TAG_NODE: |
|
95 |
if kind in (constants.TAG_INSTANCE, |
|
96 |
constants.TAG_NODEGROUP, |
|
97 |
constants.TAG_NODE): |
|
96 | 98 |
if not name: |
97 | 99 |
raise http.HttpBadRequest("Missing name on tag request") |
98 | 100 |
cl = GetClient() |
99 | 101 |
if kind == constants.TAG_INSTANCE: |
100 | 102 |
fn = cl.QueryInstances |
103 |
elif kind == constants.TAG_NODEGROUP: |
|
104 |
fn = cl.QueryGroups |
|
101 | 105 |
else: |
102 | 106 |
fn = cl.QueryNodes |
103 | 107 |
result = fn(names=[name], fields=["tags"], use_locking=False) |
Also available in: Unified diff