ThreadConfig

class DIRAC.Core.DISET.ThreadConfig.ThreadConfig(*args, **kwargs)

Bases: _local

This class allows to contain extra information when a call is done on behalf of somebody else. Typically, when a host performs the request on behalf of a user. It is not used inside DIRAC, but is used in WebAppDIRAC for example

Note that the class is a singleton, meaning that you share the same object in the whole process, however the attributes are thread locals (because of the threading.local inheritance).

Also, this class has to be populated manually, no Client class will do it for you.

__init__()
dump()

Return extra information

Returns:

tuple

getDN()

Return DN

Returns:

str

getDecorator()

Return decorator

Returns:

decorator

getGroup()

Return group name

Returns:

str

getID()

Return user ID

Returns:

tuple

getSetup()

Return setup name

Returns:

str

instance = <DIRAC.Core.DISET.ThreadConfig.ThreadConfig object>
load(tp)

Save extra information

Parameters:

tp (tuple) – contain DN, group name, setup name

reset()

Reset extra information

setDN(DN)

Set DN

Parameters:

DN (str) – DN

setDecorator(deco)

Set decorator

Parameters:

deco – decorator

setGroup(group)

Set group

Parameters:

group (str) – group name

setID(DN, group)

Set user ID

Parameters:
  • DN (str) – user DN

  • group (str) – user group

setSetup(setup)

Set setup name

Parameters:

setup (str) – setup name

DIRAC.Core.DISET.ThreadConfig.threadDeco(method)

Tread decorator

Parameters:

method – method

Returns:

wrapped method