From: Thierry Parmentelat Date: Sat, 6 Dec 2008 15:50:19 +0000 (+0000) Subject: accepts tags in getnodes filters X-Git-Tag: PLCAPI-4.3-3~31 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=cad4abce2a2551185eb3f287cf9a13d917b3a5be;p=plcapi.git accepts tags in getnodes filters --- diff --git a/PLC/Nodes.py b/PLC/Nodes.py index db62aae1..32dd4ea4 100644 --- a/PLC/Nodes.py +++ b/PLC/Nodes.py @@ -291,7 +291,8 @@ class Nodes(Table): node_filter = Filter(Node.fields, {'node_id': ints, 'hostname': strs}) sql += " AND (%s) %s" % node_filter.sql(api, "OR") elif isinstance(node_filter, dict): - node_filter = Filter(Node.fields, node_filter) + allowed_fields=dict(Node.fields.items()+Node.tags.items()) + node_filter = Filter(allowed_fields, node_filter) sql += " AND (%s) %s" % node_filter.sql(api, "AND") elif isinstance (node_filter, StringTypes): node_filter = Filter(Node.fields, {'hostname':[node_filter]}) diff --git a/PLC/Table.py b/PLC/Table.py index 0da20159..e3f550f7 100644 --- a/PLC/Table.py +++ b/PLC/Table.py @@ -259,7 +259,7 @@ class Row(dict): result.append(rejected) return result - # compute the accepts part of an update method from a list of column names, and a (list of) field dict + # compute the accepts part of an update method from a list of column names, and a (list of) fields dict @staticmethod def accepted_fields (can_update_columns, fields): result={}