Changeset 323


Ignore:
Timestamp:
10/17/14 16:32:54 (8 years ago)
Author:
bas
Message:

Added some documentation and improve some error handeling

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHANGES

    r317 r323  
     1=========== 4.5.0
     2 * new_rack_pbsmon.py: Added option -j/--joby. It will show the nodes that are used by the specified job
     3 Author: Dennis Stam
     4
     5 * JobscriptParser.py: Added a new usefull script which parses the jobscript and returns the attropl as datastructure
     6 Author: Dennis Stam
     7 
     8
    19=========== 4.4.1
    210 * new_rack_pbsmon.py: Added option -p/--property to filter on torque node properties. It will show
  • trunk/examples/JobParser.py

    r322 r323  
    154154
    155155    def read(self, filename):
    156         with open(filename, 'r') as fi:
    157             self.job_script = fi.readlines()
     156        try:
     157            with open(filename, 'r') as fi:
     158                self.job_script = fi.readlines()
     159        except IOError:
     160            error_str = "Jobscript filename does not exists: %s" %(filename)
     161            raise Exception(error_str)
    158162
    159163    def __get_pbs_args(self):
     
    243247if __name__ == '__main__':
    244248    jp = JobParser()
    245     jp.read(sys.argv[1])
     249
     250    try:
     251        jp.read(sys.argv[1])
     252    except IndexError:
     253        print("Usage: %s <jobscript>" %(sys.argv[0]))
     254        sys.exit(1)
     255       
    246256
    247257    server_name = pbs.pbs_default()
Note: See TracChangeset for help on using the changeset viewer.