PilotCStoJSONSynchronizer
CStoJSONSynchronizer Module that keeps the pilot parameters file synchronized with the information in the Operations/Pilot section of the CS. If there are additions in the CS, these are incorporated to the file. The module uploads to a web server the latest version of the pilot scripts.
- class DIRAC.WorkloadManagementSystem.Utilities.PilotCStoJSONSynchronizer.PilotCStoJSONSynchronizer
Bases:
object2 functions are executed: - It updates a JSON file with the values on the CS which can be used by Pilot3 pilots - It updates the pilot 3 files This synchronizer can be triggered at any time via PilotCStoJSONSynchronizer().sync().
- __init__()
c’tor Just setting defaults
- getCSDict(includeMasterCS: bool = True) DOKReturnType[Any] | DErrorReturnType
Gets minimal info for running a pilot, from the CS. The complete Operations section is dumped to a dictionary. A decision which VO to use will be delegated to a pilot.
- Returns:
pilotDict (containing pilots run info)
- Return type:
S_OK, S_ERROR, value is pilotDict
- DIRAC.WorkloadManagementSystem.Utilities.PilotCStoJSONSynchronizer.exclude_master_cs_aliases(urls: list[str], master_cs_url: str) list[str]
Excludes URLs that are DNS aliases of the given MasterCS server URL.
This function resolves the IP addresses of the MasterCS server and each URL in the input list. It returns a new list containing only those URLs whose hostnames do not resolve to any of the MasterCS server’s IP addresses, effectively excluding all DNS aliases of the MasterCS server.
- Parameters:
- Returns:
- A new list of URLs with all aliases of the MasterCS server removed.
If the MasterCS hostname cannot be resolved, the original list is returned unchanged.
- Return type:
Example
>>> urls = [ ... 'dips://lbvobox303.cern.ch:9135/Configuration/Server', ... 'dips://ccwlcglhcb02.in2p3.fr:9135/Configuration/Server', ... 'dips://lbvobox302.cern.ch:9135/Configuration/Server', ... ] >>> master_cs_url = "dips://mastercs.cern.ch:9135/Configuration/Server" >>> exclude_master_cs_aliases(urls, master_cs_url) ['dips://ccwlcglhcb02.in2p3.fr:9135/Configuration/Server']
Notes
If the MasterCS hostname cannot be resolved, the function returns the original list.
If a hostname in the input list cannot be resolved, it is included in the result.
The comparison is based on IP addresses, not hostnames.