Changeset 164


Ignore:
Timestamp:
09/24/08 17:08:28 (16 years ago)
Author:
bas
Message:

src/PBSQuery.py:

  • added a new function getnodes_with_property() for torque > 2.1.0
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHANGES

    r161 r164  
    11=========== 2.9.8
    2         - pbs_python.spec file patch added libdir and python defines so it will
    3           build for RHEL5.1/CentOS 5.1
     2        - pbs_python.spec file patch added libdir and python defines so it
     3          will build for RHEL5.1/CentOS 5.1
    44          by        : Michael Sternberg <sternberg add anl dot gov>
    55          applied by: Bas van der Vlies
     
    1717          Added by: Bas van der Vlies
    1818
    19         - We now have proper destructors (free memory) in SWIG for attrl and attropl
    20           attributes.
     19        - We now have proper destructors (free memory) in SWIG for attrl and
     20          attropl attributes.
     21          Added by: Bas van der Vlies
     22
     23        - PBSQuery
     24           * Added getnodes_with_property() function. This will get all nodes with
     25             a certain property, eg:
     26              - get all nodes with property 'cores8' and return all attributes:
     27                 getnodes_with_property('cores8')
     28
     29              - get all nodes with property 'cores2' and omly return the
     30                attributes 'state' and 'properties':
     31                 attrl = [ 'state', 'properties' ]
     32                 getnodes_with_property('cores2', attrl)
    2133          Added by: Bas van der Vlies
    2234
  • trunk/src/PBSQuery.py

    r161 r164  
    169169                return self.d
    170170
    171         def _statnode(self, node_name='', attrib_list=None):
     171        def _statnode(self, select='', attrib_list=None, property=None):
    172172                """Get the node config from the pbs server"""
    173173                if attrib_list:
     
    176176                        self.attribs = 'NULL'
    177177                       
     178                if property:
     179                        select = ':%s' %(property)
     180
    178181                self._connect()
    179                 nodes = pbs.pbs_statnode(self.con, node_name, self.attribs, 'NULL')
     182                nodes = pbs.pbs_statnode(self.con, select, self.attribs, 'NULL')
    180183                self._disconnect()
    181184               
     
    189192        def getnodes(self, attrib_list=None):
    190193                self._statnode('', attrib_list)
     194                return self.d
     195
     196        def getnodes_with_property(self, property, attrib_list=None):
     197                self._statnode('', attrib_list, property)
    191198                return self.d
    192199
Note: See TracChangeset for help on using the changeset viewer.