1 from __future__
import print_function
6 self.
__pattern=re.compile(
'(^[\w]+)(://)(.+)(/)(.+)')
13 if result
is not None:
14 protocol=result.group(1)
15 if protocol!=
'frontier' and protocol!=
'oracle':
16 raise RuntimeError(
'unsupported technology '+protocol)
21 if self.__servicename.find(
'(')==-1:
22 if self.__servicename.find(
'/')==-1:
24 elif self.__servicename.find(
'/') == -1:
25 self.__servlettotranslate.append(self.__servicename.split(
'(',1)[0])
26 self.__servlettotranslate.append(
'('+self.__servicename.split(
'(',1)[1])
43 """return a list, first is the servlet name, second is whatever additional parameter, if any. 47 if len(parameterDict)==0:
48 raise 'empty frontier parameters, cannot construct full connect string' 50 for k,v
in parameterDict.items():
52 if k==
'load' and v[0][0]==
'balance':
53 result+=
'(loadbalance='+v[0][1]+
')' 55 for (attrname,attrvalue)
in v:
58 fields=attrvalue.rsplit(
'/')
61 attrvalue=
'/'.
join(fields)
62 result+=
'('+k+
'url='+attrvalue+
')' 64 result+=
'('+k+
'='+attrvalue+
')' 67 result+=
'/'+schemaname
69 if __name__ ==
'__main__':
70 import cacheconfigParser
71 o=
'oracle://cms_orcoff_prep/CMS_LUMI_DEV_OFFLINE' 74 print(parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo())
76 f1=
'frontier://cmsfrontier.cern.ch:8000/LumiPrep/CMS_LUMI_DEV_OFFLINE' 79 print(parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo())
81 f2=
'frontier://(serverurl=cmsfrontier.cern.ch:8000/LumiPrep/CMS_LUMI_DEV_OFFLINE)' 84 print(parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo())
86 f3=
'frontier://(proxyurl=http://cmst0frontier.cern.ch:3128)(proxyurl=http://cmst0frontier.cern.ch:3128)(proxyurl=http://cmst0frontier1.cern.ch:3128)(proxyurl=http://cmst0frontier2.cern.ch:3128)(serverurl=http://cmsfrontier.cern.ch:8000/LumiPrep)(serverurl=http://cmsfrontier.cern.ch:8000)/LumiPrep)(serverurl=http://cmsfrontier1.cern.ch:8000/LumiPrep)(serverurl=http://cmsfrontier2.cern.ch:8000/LumiPrep)(serverurl=http://cmsfrontier3.cern.ch:8000/LumiPrep)(serverurl=http://cmsfrontier4.cern.ch:8000/LumiPrep)/CMS_LUMI_DEV_OFFLINE' 89 print(parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo())
91 f4=
'frontier://LumiPrep/CMS_LUMI_DEV_OFFLINE' 94 print(parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo(),parser.servlettotranslate())
95 if parser.needsitelocalinfo():
96 sitelocalconfig=
'/afs/cern.ch/user/x/xiezhen/w1/site-local-config.xml' 98 frontierparser.parse(sitelocalconfig)
99 print(
'full frontier string')
100 print(parser.fullfrontierStr(parser.schemaname(),frontierparser.parameterdict()))
102 f5=
'frontier://LumiPrep(otherparameter=value)/CMS_LUMI_DEV_OFFLINE' 105 print(parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo(),parser.servlettotranslate())
106 print(parser.fullfrontierStr(parser.schemaname(),frontierparser.parameterdict()))
108 f6=
'frontier://LumiCalc/CMS_LUMI_PROD' 111 print(parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo(),parser.servlettotranslate())
112 print(parser.fullfrontierStr(parser.schemaname(),frontierparser.parameterdict()))
def needsitelocalinfo(self)
S & print(S &os, JobReport::InputFile const &f)
def __init__(self, connectstr)
static std::string join(char **cmd)
def fullfrontierStr(self, schemaname, parameterDict)
def servlettotranslate(self)