Utils

class glados.utils.PyJSON(d)[source]

Bases: object

from_dict(d)[source]
get(key, default=None)[source]
to_dict()[source]
Return type

dict

glados.utils.check_for_env_vars(value)[source]

Check an input value to see if it is an env_var or enc_env_var and get the value.

Parameters

value (Union[str, dict]) – input to check.

Returns

Returns the value of the var from either the passed in value, or the env var value.

Return type

Any

Raises

KeyError if the env var is not set for what youre tying to get.

glados.utils.decode_kms(ciphertext_blob)[source]

Decode a secret using the IAM role of the lambda function.

Parameters

ciphertext_blob (str) – ciphertext_blob to decode

Returns

Decoded KMS data

Return type

obj: str

glados.utils.get_enc_var(var_name)[source]

Get an encrypted ENV VAR

Parameters

var_name (str) –

Return type

str

glados.utils.get_var(var_name)[source]

Get an ENV VAR

Parameters

var_name (str) –

glados.utils.read_config(config_file)[source]
Parameters

config_file (str) –