/[pdpsoft]/nl.nikhef.pdp.dynsched-pbs-plugin/trunk/vomaxjobs-maui.cin
ViewVC logotype

Diff of /nl.nikhef.pdp.dynsched-pbs-plugin/trunk/vomaxjobs-maui.cin

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2145 by templon, Fri Oct 8 13:11:04 2010 UTC revision 2146 by templon, Fri Jan 14 16:11:45 2011 UTC
# Line 1  Line 1 
1  #!/usr/bin/python2  #!/usr/bin/python2
2  # vomaxjobs-maui  # vomaxjobs-maui
3  # J. A. Templon, NIKHEF/PDP 2005  # J. A. Templon, NIKHEF/PDP 2005
4  # @(#)$Id$  #       $URL$  
5    #       $Id$    
6    
7  # generate generic information on maximum job  # generate generic information on maximum job
8  # counts per VO.  This version works with Maui.  # counts per VO.  This version works with Maui.
# Line 15  import getopt Line 16  import getopt
16  import string  import string
17    
18  try:  try:
19      opts, args = getopt.getopt(sys.argv[1:], "h:i:",      opts, args = getopt.getopt(sys.argv[1:], "h:i:k:",
20                                 ["host=","input="])                                 ["host=","input=","keyfile="])
21  except getopt.GetoptError:  except getopt.GetoptError:
22      # print help information and exit:      # print help information and exit:
23      print sys.argv[0] + ": error parsing command line: " + \      print sys.argv[0] + ": error parsing command line: " + \
# Line 26  except getopt.GetoptError: Line 27  except getopt.GetoptError:
27    
28  schedhost = None  schedhost = None
29  infile = None  infile = None
30    keyarg = None
31    
32  for o, a in opts:  for o, a in opts:
33      if o in ("-h", "--host"):      if o in ("-h", "--host"):
34          schedhost = a          schedhost = a
35      elif o in ("-i", "--input"):      elif o in ("-i", "--input"):
36          infile = a          infile = a
37        elif o in ("-k", "--keyfile"):
38            keyarg = a
39                    
40  if infile:  if infile:
41      cmd = '/bin/cat ' + infile      cmd = '/bin/cat ' + infile
# Line 39  else: Line 43  else:
43      cmd = 'diagnose -g'      cmd = 'diagnose -g'
44      if schedhost:      if schedhost:
45          cmd = cmd + ' --host=' + schedhost          cmd = cmd + ' --host=' + schedhost
46        if keyarg:
47            cmd = cmd + ' --keyfile=' + keyarg
48            
49  import commands  import commands
50  (stat, out) = commands.getstatusoutput(cmd)  (stat, out) = commands.getstatusoutput(cmd)

Legend:
Removed from v.2145  
changed lines
  Added in v.2146

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28