Changeset 191


Ignore:
Timestamp:
05/14/09 13:47:18 (15 years ago)
Author:
bas
Message:

src/PBSQuery.py:

  • fixed an error in the getnode, getqueue and getjob functions

update changes

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHANGES

    r189 r191  
    3636
    3737        Author: Bas van der Vlies
     38
     39        - Added iter object for job, node, queue and server objects, eg:
     40          node = p.getnode('gb-r1n1')
     41          print node.name
     42          for attrib in node:
     43                print '%\t%s = %s' %(attrib, node[attrib])
     44        Author: Bas van der Vlies
     45
     46        - fixed an error in getnode, getqueue and getjob, return empty
     47          dictionary if not found
     48        Author: Bas van der Vlies
    3849       
    3950        - New build system for rpm packages, make -f Makefile.rpm
    4051          Author: Michel Jouvin <jouvin add lal dot in2p3 dot fr>
    41           Applied: Bas van der Vlies
     52
     53        Applied: Bas van der Vlies
    4254
    4355=========== 3.0.1
  • trunk/debian/changelog

    r189 r191  
    33  *  PBSQuery:
    44         New data structure. In the old structure it is a dictionary
    5          with a value and the value is a string. This is changed that 
     5         with a value and the value is a string. This is changed that
    66         dictionary values are now of type list or dictionary depends
    77         on the value of keyword, eg for a node:
    8           - np = 2: 
    9                 - node['np'] = [ '2' ] 
     8          - np = 2:
     9                - node['np'] = [ '2' ]
    1010          - properties = cores2, mem4gb, parallel
    11                 - node['properties'] = [ 'cores2', 'mem4gb', 'parallel' ] 
    12           - status = arch=x86_64,sessions=22599,,size=70627864kb, ...                                                                                   
    13                 - node['status']['arch'] = [ 'x86_64' ] 
     11                - node['properties'] = [ 'cores2', 'mem4gb', 'parallel' ]
     12          - status = arch=x86_64,sessions=22599,,size=70627864kb, ...
     13                - node['status']['arch'] = [ 'x86_64' ]
    1414                - node['status']['sessions'] = [ '222599' ]
    1515                - ...
     
    2121         example:
    2222                p = PBSQuery()
    23                 p.new_data_structure() 
     23                p.new_data_structure()
    2424
    2525                nodes = p.getnodes()
     
    2828         Author: Bas van der Vlies
    2929
    30   * PBSQuery
    31         For old and new data structure we now can use another syntax:
    32          - node['np'] and node.np are equivalent
    33 
    34         This new syntax works for all keywords. 
    35         Author: Bas van der Vlies
    36 
    37  -- Bas van der Vlies <basv@sara.nl>  Wed, 13 May 2009 16:20:27 +0200
     30  *  PBSQuery:
     31        For old and new data structure we now can use another syntax:
     32         - node['np'] and node.np are equivalent
     33
     34        This new syntax works for all keywords.
     35        Author: Bas van der Vlies
     36
     37  *  PBSQuery:
     38        Added iter object for job, node, queue and server objects, eg:
     39                node = p.getnode('gb-r1n1')
     40                print node.name
     41                for attrib in node:
     42                        print '%\t%s = %s' %(attrib, node[attrib])
     43        Author: Bas van der Vlies
     44
     45  *  PBSQuery:
     46        fixed an error in getnode, getqueue and getjob, return
     47        empty dictionary if not found.
     48        Author: Bas van der Vlies
     49
     50  *  PBSQuery:
     51        New build system for rpm packages, make -f Makefile.rpm
     52        Author: Michel Jouvin <jouvin add lal dot in2p3 dot fr>
     53        Applied: Bas van der Vlies
     54
     55 -- Bas van der Vlies <bas@rc.sara.nl>  Thu, 14 May 2009 13:41:00 +0200
    3856
    3957pbs-python (3.0.1-2) intrepid; urgency=low
  • trunk/src/PBSQuery.py

    r190 r191  
    227227        def getqueue(self, name, attrib_list=None):
    228228                self._statqueue(name, attrib_list)
    229                 return self.d[name]
     229                try:
     230                        return self.d[name]
     231                except KeyError, detail:
     232                        return self.d
    230233       
    231234        def getqueues(self, attrib_list=None):
     
    251254        def getnode(self, name, attrib_list=None):
    252255                self._statnode(name, attrib_list)
    253                 return self.d[name]
     256                try:
     257                        return self.d[name]
     258                except KeyError, detail:
     259                        return self.d
    254260       
    255261        def getnodes(self, attrib_list=None):
     
    280286
    281287                self._statjob(name, attrib_list)
    282                 return self.d[name]
     288                try:
     289                        return self.d[name]
     290                except KeyError, detail:
     291                        return self.d
    283292       
    284293        def getjobs(self, attrib_list=None):
Note: See TracChangeset for help on using the changeset viewer.