1- """ ResourceStatus
1+ """ResourceStatus
22
33Module that acts as a helper for knowing the status of a resource.
44It takes care of switching between the CS and the RSS.
@@ -46,7 +46,7 @@ def getElementStatus(self, elementName, elementType, statusType=None, default=No
4646
4747 :param elementName: name of the element or list of element names
4848 :type elementName: str, list
49- :param elementType: type of the element (StorageElement, ComputingElement, FTS, Catalog )
49+ :param elementType: type of the element (StorageElement, ComputingElement, FTS)
5050 :type elementType: str
5151 :param statusType: type of the status (meaningful only when elementType==StorageElement)
5252 :type statusType: None, str, list
@@ -65,8 +65,6 @@ def getElementStatus(self, elementName, elementType, statusType=None, default=No
6565 S_ERROR( xyz.. )
6666 >>> getElementStatus('ThisIsAWrongName', 'StorageElement', 'WriteAccess')
6767 S_ERROR( xyz.. )
68- >>> getElementStatus('A_file_catalog', 'FileCatalog')
69- S_OK( { 'A_file_catalog': { 'all': 'Active' } } } )
7068 >>> getElementStatus('SE1', 'StorageElement', ['ReadAccess', 'WriteAccess'])
7169 S_OK( { 'SE1': { 'ReadAccess': 'Banned' , 'WriteAccess': 'Active'} } } )
7270 >>> getElementStatus('SE1', 'StorageElement')
@@ -79,7 +77,7 @@ def getElementStatus(self, elementName, elementType, statusType=None, default=No
7977 'CE2': {'all': 'Probing'}}}
8078 """
8179
82- allowedParameters = ["StorageElement" , "ComputingElement" , "FTS" , "Catalog" ]
80+ allowedParameters = ["StorageElement" , "ComputingElement" , "FTS" ]
8381
8482 if elementType not in allowedParameters :
8583 return S_ERROR (f"{ elementType } in not in the list of the allowed parameters: { allowedParameters } " )
@@ -92,8 +90,6 @@ def getElementStatus(self, elementName, elementType, statusType=None, default=No
9290 statusType = ["all" ]
9391 elif elementType == "FTS" :
9492 statusType = ["all" ]
95- elif elementType == "Catalog" :
96- statusType = ["all" ]
9793
9894 return self .__getRSSElementStatus (elementName , elementType , statusType , vO )
9995
@@ -102,7 +98,7 @@ def setElementStatus(self, elementName, elementType, statusType, status, reason=
10298
10399 :param elementName: name of the element
104100 :type elementName: str
105- :param elementType: type of the element (StorageElement, ComputingElement, FTS, Catalog )
101+ :param elementType: type of the element (StorageElement, ComputingElement, FTS)
106102 :type elementType: str
107103 :param statusType: type of the status (meaningful only when elementType==StorageElement)
108104 :type statusType: str
@@ -159,7 +155,7 @@ def __getRSSElementStatus(self, elementName, elementType, statusType, vO):
159155
160156 :param elementName: name of the element or list of element names
161157 :type elementName: str, list
162- :param elementType: type of the element (StorageElement, ComputingElement, FTS, Catalog )
158+ :param elementType: type of the element (StorageElement, ComputingElement, FTS)
163159 :type elementType: str
164160 :param statusType: type of the status (meaningful only when elementType==StorageElement,
165161 otherwise it is 'all' or ['all'])
@@ -178,7 +174,7 @@ def __getCSElementStatus(self, elementName, elementType, statusType, default):
178174
179175 :param elementName: name of the element
180176 :type elementName: str
181- :param elementType: type of the element (StorageElement, ComputingElement, FTS, Catalog )
177+ :param elementType: type of the element (StorageElement, ComputingElement, FTS)
182178 :type elementType: str
183179 :param statusType: type of the status (meaningful only when elementType==StorageElement)
184180 :type statusType: str, list
@@ -190,12 +186,9 @@ def __getCSElementStatus(self, elementName, elementType, statusType, default):
190186 if elementType in ("ComputingElement" , "FTS" ):
191187 return S_OK ({elementName : {"all" : "Active" }})
192188
193- # If we are here it is because elementType is either 'StorageElement' or 'Catalog '
189+ # If we are here it is because elementType is 'StorageElement'
194190 if elementType == "StorageElement" :
195191 cs_path = "/Resources/StorageElements"
196- elif elementType == "Catalog" :
197- cs_path = "/Resources/FileCatalogs"
198- statusType = ["Status" ]
199192
200193 if not isinstance (elementName , list ):
201194 elementName = [elementName ]
@@ -263,19 +256,14 @@ def __setCSElementStatus(self, elementName, elementType, statusType, status):
263256 if elementType in ("ComputingElement" , "FTS" ):
264257 return S_OK ()
265258
266- # If we are here it is because elementType is either 'StorageElement' or 'Catalog '
259+ # If we are here it is because elementType is 'StorageElement'
267260 statuses = self .rssConfig .getConfigStatusType (elementType )
268261 if statusType not in statuses :
269262 gLogger .error (f"{ statusType } is not a valid statusType" )
270263 return S_ERROR (f"{ statusType } is not a valid statusType: { statuses } " )
271264
272265 if elementType == "StorageElement" :
273266 cs_path = "/Resources/StorageElements"
274- elif elementType == "Catalog" :
275- cs_path = "/Resources/FileCatalogs"
276- # FIXME: This a probably outdated location (new one is in /Operations/[]/Services/Catalogs)
277- # but needs to be VO-aware
278- statusType = "Status"
279267
280268 csAPI = CSAPI ()
281269 csAPI .setOption (f"{ cs_path } /{ elementName } /{ elementType } /{ statusType } " , status )
0 commit comments