Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Public Attributes
SampleBroker.MyBroker Class Reference

List of all members.

Public Member Functions

def __init__
def SortTargets

Public Attributes

 proxypath
 certificatepath
 keypath
 cacertificatesdir
 args

Detailed Description

Definition at line 11 of file SampleBroker.py.


Constructor & Destructor Documentation

def SampleBroker.MyBroker.__init__ (   self,
  usercfg 
)

Definition at line 13 of file SampleBroker.py.

00013 
00014     def __init__(self, usercfg):
00015 
00016         # Extract some useful information from the broker configuration
00017 
00018         self.proxypath = usercfg.ProxyPath()
00019         self.certificatepath = usercfg.CertificatePath()
00020         self.keypath = usercfg.KeyPath()
00021         self.cacertificatesdir = usercfg.CACertificatesDirectory()
00022         pos = usercfg.Broker().second.find(':')
00023         if pos > 0:
00024             self.args = usercfg.Broker.second[pos + 1:]
00025         else:
00026             self.args = ""


Member Function Documentation

def SampleBroker.MyBroker.SortTargets (   self,
  PossibleTargets,
  job 
)

Definition at line 27 of file SampleBroker.py.

00027 
00028     def SortTargets(self, PossibleTargets, job):
00029 
00030         # Some printouts - only as an example
00031 
00032         print 'Proxy Path:', self.proxypath
00033         print 'Certificate Path:', self.certificatepath
00034         print 'Key Path:', self.keypath
00035         print 'CA Certificates Dir:', self.cacertificatesdir
00036 
00037         print 'Broker arguments:', self.args
00038 
00039         print 'JobName:', job.Identification.JobName
00040         print 'Executable:', job.Application.Executable.Name
00041         for i in range(job.Application.Executable.Argument.size()):
00042             print 'Argument', i, ':', job.Application.Executable.Argument[i]
00043 
00044         # Broker implementation starts here
00045 
00046         print 'Targets before brokering:'
00047 
00048         for t in PossibleTargets:
00049             print t.url.str()
00050 
00051         print 'Randomizing...'
00052 
00053         random.shuffle(PossibleTargets)
00054 
00055         print 'Targets after brokering:'
00056 
00057         for t in PossibleTargets:
00058             print t.url.str()

Member Data Documentation

Definition at line 23 of file SampleBroker.py.

Definition at line 20 of file SampleBroker.py.

Definition at line 18 of file SampleBroker.py.

Definition at line 19 of file SampleBroker.py.

Definition at line 17 of file SampleBroker.py.


The documentation for this class was generated from the following file: