24 |
|
## for python 2.2 add the pyexpat.so to PYTHONPATH |
25 |
|
pythonV=sys.version.split(' ')[0] |
26 |
|
if pythonV.find('2.2') >= 0 : |
27 |
< |
Crabpydir=commands.getoutput('which crab') |
28 |
< |
Topdir=string.replace(Crabpydir,'/python/crab','') |
29 |
< |
extradir=Topdir+'/DLSAPI/extra' |
30 |
< |
if sys.path.count(extradir) <= 0: |
31 |
< |
if os.path.exists(extradir): |
32 |
< |
sys.path.insert(0, extradir) |
27 |
> |
Crabpydir=commands.getoutput('which crab') |
28 |
> |
Topdir=string.replace(Crabpydir,'/python/crab','') |
29 |
> |
extradir=Topdir+'/DLSAPI/extra' |
30 |
> |
if sys.path.count(extradir) <= 0: |
31 |
> |
if os.path.exists(extradir): |
32 |
> |
sys.path.insert(0, extradir) |
33 |
|
|
34 |
|
|
35 |
|
class DLSError: |
61 |
|
def __init__(self, type, cfg_params): |
62 |
|
self.cfg_params = cfg_params |
63 |
|
jobtype = self.cfg_params['CRAB.jobtype'] |
64 |
– |
##SL I don't like all this hardcoded and jobtype dependent info put here |
64 |
|
if type=="DLS_TYPE_DLI": |
65 |
< |
if jobtype.count('orca')>0: |
66 |
< |
endpoint="lfc-cms-test.cern.ch/grid/cms/DLS/LFCProto" |
67 |
< |
else: |
68 |
< |
try: |
70 |
< |
endpoint=self.cfg_params['CMSSW.dls_endpoint'] |
71 |
< |
except KeyError: |
72 |
< |
endpoint="lfc-cms-test.cern.ch/grid/cms/DLS/LFC" |
65 |
> |
try: |
66 |
> |
endpoint=self.cfg_params['CMSSW.dls_endpoint'] |
67 |
> |
except KeyError: |
68 |
> |
endpoint="prod-lfc-cms-central.cern.ch/grid/cms/DLS/LFC" |
69 |
|
|
70 |
|
try: |
71 |
|
import xml.dom.ext.reader |
81 |
|
raise CrabException(msg) |
82 |
|
|
83 |
|
elif type=="DLS_TYPE_MYSQL": |
84 |
< |
if jobtype.count('orca')>0: |
85 |
< |
endpoint="lfc-cms-test.cern.ch/grid/cms/DLS/LFCProto" |
86 |
< |
else: |
87 |
< |
try: |
92 |
< |
endpoint=self.cfg_params['CMSSW.dls_endpoint'] |
93 |
< |
except KeyError: |
94 |
< |
endpoint="lxgate10.cern.ch:18081" |
84 |
> |
try: |
85 |
> |
endpoint=self.cfg_params['CMSSW.dls_endpoint'] |
86 |
> |
except KeyError: |
87 |
> |
endpoint="lxgate10.cern.ch:18081" |
88 |
|
else: |
89 |
|
msg = "DLS type %s not among the supported DLS ( DLS_TYPE_DLI and DLS_TYPE_MYSQL ) "%type |
90 |
|
raise CrabException(msg) |