6
6
7
7
Operations/
8
8
Defaults/
9
+ someOption = someValue
10
+ aSecondOption = aSecondValue
11
+ specificVo/
9
12
someSection/
10
- someOption = someValue
11
- aSecondOption = aSecondValue
12
- Production/
13
- someSection/
14
- someOption = someValueInProduction
15
- aSecondOption = aSecondValueInProduction
16
- Certification/
17
- someSection/
18
- someOption = someValueInCertification
13
+ someOption = someValueInVO
19
14
20
15
The following calls would give different results based on the setup::
21
16
22
17
Operations().getValue('someSection/someOption')
23
- - someValueInProduction if we are in 'Production' setup
24
- - someValueInCertification if we are in 'Certification' setup
25
-
26
- Operations().getValue('someSection/aSecondOption')
27
- - aSecondValueInProduction if we are in 'Production' setup
28
- - aSecondValue if we are in 'Certification' setup <- looking in Defaults
29
- since there's no Certification/someSection/aSecondOption
30
-
18
+ - someValueInVO if we are in 'specificVo' vo
19
+ - someValue if we are in any other VO
31
20
32
- At the same time, for multi-VO installations, it is also possible to specify different options per-VO,
33
- like the following::
34
-
35
- Operations/
36
- aVOName/
37
- Defaults/
38
- someSection/
39
- someOption = someValue
40
- aSecondOption = aSecondValue
41
- Production/
42
- someSection/
43
- someOption = someValueInProduction
44
- aSecondOption = aSecondValueInProduction
45
- Certification/
46
- someSection/
47
- someOption = someValueInCertification
48
- anotherVOName/
49
- Defaults/
50
- someSectionName/
51
- someOptionX = someValueX
52
- aSecondOption = aSecondValue
53
- setupName/
54
- someSection/
55
- someOption = someValueInProduction
56
- aSecondOption = aSecondValueInProduction
57
-
58
- For this case it becomes then important for the Operations() objects to know the VO name
21
+ It becomes then important for the Operations() objects to know the VO name
59
22
for which we want the information, and this can be done in the following ways.
60
23
61
24
1. by specifying the VO name directly::
@@ -98,9 +61,7 @@ def __init__(self, vo=False, group=False, setup=False):
98
61
"""
99
62
self .__uVO = vo
100
63
self .__uGroup = group
101
- self .__uSetup = setup
102
64
self .__vo = False
103
- self .__setup = False
104
65
self .__discoverSettings ()
105
66
106
67
def __discoverSettings (self ):
@@ -119,12 +80,6 @@ def __discoverSettings(self):
119
80
result = getVOfromProxyGroup ()
120
81
if result ["OK" ]:
121
82
self .__vo = result ["Value" ]
122
- # Set the setup
123
- self .__setup = False
124
- if self .__uSetup :
125
- self .__setup = self .__uSetup
126
- else :
127
- self .__setup = CSGlobals .getSetup ()
128
83
129
84
def __getCache (self ):
130
85
Operations .__cacheLock .acquire ()
@@ -134,7 +89,7 @@ def __getCache(self):
134
89
Operations .__cache = {}
135
90
Operations .__cacheVersion = currentVersion
136
91
137
- cacheKey = (self .__vo , self . __setup )
92
+ cacheKey = (self .__vo ,)
138
93
if cacheKey in Operations .__cache :
139
94
return Operations .__cache [cacheKey ]
140
95
@@ -155,14 +110,13 @@ def __getCache(self):
155
110
pass
156
111
157
112
def __getSearchPaths (self ):
158
- paths = ["/Operations/Defaults" , f"/Operations/ { self . __setup } " ]
113
+ paths = ["/Operations/Defaults" ]
159
114
if not self .__vo :
160
115
globalVO = CSGlobals .getVO ()
161
116
if not globalVO :
162
117
return paths
163
118
self .__vo = CSGlobals .getVO ()
164
- paths .append (f"/Operations/{ self .__vo } /Defaults" )
165
- paths .append (f"/Operations/{ self .__vo } /{ self .__setup } " )
119
+ paths .append (f"/Operations/{ self .__vo } /" )
166
120
return paths
167
121
168
122
def getValue (self , optionPath , defaultValue = None ):
@@ -202,26 +156,6 @@ def getOptionsDict(self, sectionPath):
202
156
data [opName ] = sectionCFG [opName ]
203
157
return S_OK (data )
204
158
205
- def getPath (self , option , vo = False , setup = False ):
206
- """
207
- Generate the CS path for an option:
208
-
209
- - if vo is not defined, the helper's vo will be used for multi VO installations
210
- - if setup evaluates False (except None) -> The helpers setup will be used
211
- - if setup is defined -> whatever is defined will be used as setup
212
- - if setup is None -> Defaults will be used
213
-
214
- :param option: path with respect to the Operations standard path
215
- :type option: string
216
- """
217
-
218
- for path in self .__getSearchPaths ():
219
- optionPath = os .path .join (path , option )
220
- value = gConfig .getValue (optionPath , "NoValue" )
221
- if value != "NoValue" :
222
- return optionPath
223
- return ""
224
-
225
159
def getMonitoringBackends (self , monitoringType = None ):
226
160
"""
227
161
Chooses the type of backend to use (Monitoring and/or Accounting) depending on the MonitoringType.
0 commit comments