Operations

This helper looks in the /Operations section of the CS, considering its specific nature: the /Operations section is designed in a way that each configuration can be specific to a Setup, while maintaining a default.

So, for example, given the following /Operations section:

Operations/
    Defaults/
        someSection/
            someOption = someValue
            aSecondOption = aSecondValue
    Production/
        someSection/
            someOption = someValueInProduction
            aSecondOption = aSecondValueInProduction
    Certification/
        someSection/
            someOption = someValueInCertification

The following calls would give different results based on the setup:

Operations().getValue('someSection/someOption')
  - someValueInProduction if we are in 'Production' setup
  - someValueInCertification if we are in 'Certification' setup

Operations().getValue('someSection/aSecondOption')
  - aSecondValueInProduction if we are in 'Production' setup
  - aSecondValue if we are in 'Certification' setup    <- looking in Defaults
                                                          since there's no Certification/someSection/aSecondOption

At the same time, for multi-VO installations, it is also possible to specify different options per-VO, like the following:

Operations/
    aVOName/
        Defaults/
            someSection/
                someOption = someValue
                aSecondOption = aSecondValue
        Production/
            someSection/
                someOption = someValueInProduction
                aSecondOption = aSecondValueInProduction
        Certification/
            someSection/
                someOption = someValueInCertification
    anotherVOName/
        Defaults/
            someSectionName/
                someOptionX = someValueX
                aSecondOption = aSecondValue
        setupName/
            someSection/
                someOption = someValueInProduction
                aSecondOption = aSecondValueInProduction

For this case it becomes then important for the Operations() objects to know the VO name for which we want the information, and this can be done in the following ways.

  1. by specifying the VO name directly:
Operations(vo=anotherVOName).getValue(‘someSectionName/someOptionX’)
  1. by give a group name:
Operations(group=thisIsAGroupOfVO_X).getValue(‘someSectionName/someOptionX’)

3. if no VO nor group is provided, the VO will be guessed from the proxy, but this works iff the object is instantiated by a proxy (and not, e.g., using a server certificate)

class DIRAC.ConfigurationSystem.Client.Helpers.Operations.Operations(vo=False, group=False, setup=False)

Bases: object

Operations class

The /Operations CFG section is maintained in a cache by an Operations object

__init__(vo=False, group=False, setup=False)

c’tor

Setting some defaults

getOptions(sectionPath, listOrdered=False)
getOptionsDict(sectionPath)
getPath(option, vo=False, setup=False)

Generate the CS path for an option:

  • if vo is not defined, the helper’s vo will be used for multi VO installations
  • if setup evaluates False (except None) -> The helpers setup will be used
  • if setup is defined -> whatever is defined will be used as setup
  • if setup is None -> Defaults will be used
Parameters:option (string) – path with respect to the Operations standard path
getSections(sectionPath, listOrdered=False)
getValue(optionPath, defaultValue=None)
setGroup(**kwargs)

False to auto detect VO

setSetup(**kwargs)

False to auto detect

setVO(**kwargs)

False to auto detect VO