ConfigurationClient

Basic functions for interacting with CS objects

class DIRAC.ConfigurationSystem.private.ConfigurationClient.ConfigurationClient(fileToLoadList=None)

Bases: object

__init__(fileToLoadList=None)

C’or

Parameters:

fileToLoadList (list) – files to load

addListenerToNewVersionEvent(functor)

Add listener to new version event

Parameters:

functor (str) – functor

dumpCFGAsLocalCache(fileName=None, raw=False)

Dump local CFG cache to file

Parameters:
  • fileName (str) – file name

  • raw (bool) – raw

Returns:

S_OK(str)/S_ERROR()

dumpLocalCFGToFile(fileName)

Dump local configuration to file

Parameters:

fileName (str) – file name

Returns:

S_OK()/S_ERROR()

dumpRemoteCFGToFile(fileName)

Dump remote configuration to file

Parameters:

fileName (str) – file name

Returns:

S_OK()/S_ERROR()

forceRefresh(fromMaster=False)

Force refresh

Parameters:

fromMaster (bool) – refresh from master

Returns:

S_OK()/S_ERROR()

getConfigurationTree(root='', *filters)

Create a dictionary with all sections, subsections and options starting from given root. Result can be filtered.

Parameters:
  • root (str) – Starting point in the configuration tree.

  • filters (str or list[str]) – Select results that contain given substrings (check full path, i.e. with option name)

Returns:

S_OK(dict)/S_ERROR() – dictionary where keys are paths taken from the configuration (e.g. /Systems/Configuration/…). Value is “None” when path points to a section or not “None” if path points to an option.

getOption(optionPath, typeValue=None)

Get configuration option

Parameters:
  • optionPath (str) – option path

  • typeValue – type of value

Returns:

S_OK()/S_ERROR()

getOptions(sectionPath, listOrdered=True)

Get configuration options

Parameters:
  • sectionPath (str) – section path

  • listOrdered (bool) – ordered

Returns:

S_OK(list)/S_ERROR()

getOptionsDict(sectionPath)

Get configuration options in dictionary

Parameters:

sectionPath (str) – section path

Returns:

S_OK(dict)/S_ERROR()

getOptionsDictRecursively(sectionPath)

Get configuration options in dictionary recursively

Parameters:

sectionPath (str) – section path

Returns:

S_OK(dict)/S_ERROR()

getSections(sectionPath, listOrdered=True)

Get configuration sections

Parameters:
  • sectionPath (str) – section path

  • listOrdered (bool) – ordered

Returns:

S_OK(list)/S_ERROR()

getServersList()

Get list of servers

Returns:

list

getValue(optionPath, defaultValue=None)

Get configuration value

Parameters:
  • optionPath (str) – option path

  • defaultValue – default value

Returns:

type(defaultValue)

loadCFG(cfg)

Load CFG

Parameters:

cfg (CFG()) – CFG object

Returns:

S_OK()/S_ERROR()

loadFile(fileName)

Load file

Parameters:

fileName (str) – file name

Returns:

S_OK()/S_ERROR()

setOptionValue(optionPath, value)

Set a value in the local configuration

Parameters:
  • optionPath (str) – option path

  • value (str) – value

useServerCertificate()

Get using server certificate status

Returns:

bool