X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FNodeGroups.py;h=90bd5f90a3b051f8ec70a2a0293933a6c318a407;hb=e499729c53c1bbfcfe3ec46043477f1e28c04119;hp=34d73b0f1da178bae8b6c4e85d66c8447baab937;hpb=99a5ef4577d6addbc08a5e04ddab65d3c3f4198f;p=plcapi.git diff --git a/PLC/NodeGroups.py b/PLC/NodeGroups.py index 34d73b0..90bd5f9 100644 --- a/PLC/NodeGroups.py +++ b/PLC/NodeGroups.py @@ -4,7 +4,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: NodeGroups.py,v 1.16 2006/11/02 18:32:55 mlhuang Exp $ +# $Id: NodeGroups.py,v 1.18 2006/11/09 03:07:42 mlhuang Exp $ # from types import StringTypes @@ -104,14 +104,14 @@ class NodeGroups(Table): database. """ - def __init__(self, api, nodegroup_filter = None): - Table.__init__(self, api, NodeGroup) + def __init__(self, api, nodegroup_filter = None, columns = None): + Table.__init__(self, api, NodeGroup, columns) sql = "SELECT %s FROM view_nodegroups WHERE True" % \ - ", ".join(NodeGroup.fields) + ", ".join(self.columns) if nodegroup_filter is not None: - if isinstance(nodegroup_filter, list): + if isinstance(nodegroup_filter, (list, tuple, set)): # Separate the list into integers and strings ints = filter(lambda x: isinstance(x, (int, long)), nodegroup_filter) strs = filter(lambda x: isinstance(x, StringTypes), nodegroup_filter)