bartender.shared.dirac#

Attributes#

Functions#

get_time_left_on_proxy(→ int)

Get the time left on the current proxy.

proxy_init(→ None)

Create or renew DIRAC proxy.

sync_proxy_init(→ None)

Create or renew DIRAC proxy.

_proxy_init_command(→ list[str])

renew_proxy_task(→ None)

Task that makes sure the proxy is renewed when it is close to expiring.

make_valid_dirac_proxy(→ int)

Make valid dirac proxy.

setup_proxy_renewer(→ None)

Set up a renewer for the DIRAC proxy.

teardown_proxy_renewer(→ None)

Tear down the renewer for the DIRAC proxy.

Module Contents#

bartender.shared.dirac.logger#
bartender.shared.dirac.get_time_left_on_proxy() int#

Get the time left on the current proxy.

Returns:

The time left on the current proxy in seconds.

Raises:

ValueError – If failed to get proxy info.

Return type:

int

async bartender.shared.dirac.proxy_init(config: bartender.shared.dirac_config.ProxyConfig) None#

Create or renew DIRAC proxy.

Parameters:

config (bartender.shared.dirac_config.ProxyConfig) – How to create a new proxy.

Raises:

CalledProcessError – If failed to create proxy.

Return type:

None

bartender.shared.dirac.sync_proxy_init(config: bartender.shared.dirac_config.ProxyConfig) None#

Create or renew DIRAC proxy.

Parameters:

config (bartender.shared.dirac_config.ProxyConfig) – How to create a new proxy.

Return type:

None

bartender.shared.dirac._proxy_init_command(config: bartender.shared.dirac_config.ProxyConfig) list[str]#
Parameters:

config (bartender.shared.dirac_config.ProxyConfig) –

Return type:

list[str]

async bartender.shared.dirac.renew_proxy_task(config: bartender.shared.dirac_config.ProxyConfig) None#

Task that makes sure the proxy is renewed when it is close to expiring.

Parameters:

config (bartender.shared.dirac_config.ProxyConfig) – How to create a new proxy.

Return type:

None

async bartender.shared.dirac.make_valid_dirac_proxy(config: bartender.shared.dirac_config.ProxyConfig) int#

Make valid dirac proxy.

Parameters:

config (bartender.shared.dirac_config.ProxyConfig) – How to create a new proxy.

Returns:

The time left on the current proxy in seconds.

Return type:

int

bartender.shared.dirac.Renewer#
bartender.shared.dirac.renewer: Renewer | None = None#
bartender.shared.dirac.setup_proxy_renewer(config: bartender.shared.dirac_config.ProxyConfig) None#

Set up a renewer for the DIRAC proxy.

Parameters:

config (bartender.shared.dirac_config.ProxyConfig) – How to create a new proxy.

Raises:

ValueError – If there is already a renewer with a different config.

Return type:

None

async bartender.shared.dirac.teardown_proxy_renewer() None#

Tear down the renewer for the DIRAC proxy.

Return type:

None