config
This module encapsulates the configuration of AWS Deadline Cloud on a workstation.
By default, configuration is stored in ~/.deadline/config. If a user sets
the environment variable DEADLINE_CONFIG_FILE_PATH, it is used as the configuration
file path instead.
clear_setting(setting_name, config=None)
¶
Sets the value of the specified setting back to the default value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
The full setting name, like |
required |
config
|
Optional[ConfigParser]
|
If provided clears the setting in the parser and does not save to disk. |
None
|
get_best_profile_for_farm(farm_id, queue_id=None)
¶
Finds the best AWS profile for the specified farm and queue IDs. Chooses the first match from: 1. The default AWS profile if its default farm matches. 2. AWS profiles whose default farm and queue IDs match. 3. AWS profiles whose default farm matches. 4. If there were no matches, returns the default AWS profile.
get_setting(setting_name, config=None)
¶
Gets the value of the specified setting, returning the default if not configured. Raises an exception if the setting does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
The full setting name, like |
required |
config
|
ConfigParser
|
The config file read with |
None
|
get_setting_default(setting_name, config=None)
¶
Gets the default value for the setting setting_name.
Raises an exception if the setting does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
The full setting name, like |
required |
config
|
Optional[ConfigParser]
|
The config file read with |
None
|
set_setting(setting_name, value, config=None)
¶
Sets the value of the specified setting, returning the default if not configured. Raises an exception if the setting does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
The full setting name, like |
required |
value
|
bool | int | float | str
|
The value to set. |
required |
config
|
Optional[ConfigParser]
|
If provided sets the setting in the parser and does not save to disk. |
None
|
str2bool(value)
¶
Converts a string to boolean, accepting a variety of on/off, true/false, 0/1 variants.
config_file ¶
clear_setting(setting_name, config=None)
¶
Sets the value of the specified setting back to the default value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
The full setting name, like |
required |
config
|
Optional[ConfigParser]
|
If provided clears the setting in the parser and does not save to disk. |
None
|
get_best_profile_for_farm(farm_id, queue_id=None)
¶
Finds the best AWS profile for the specified farm and queue IDs. Chooses the first match from: 1. The default AWS profile if its default farm matches. 2. AWS profiles whose default farm and queue IDs match. 3. AWS profiles whose default farm matches. 4. If there were no matches, returns the default AWS profile.
get_cache_directory()
¶
Get the cache directory.
get_config_file_path()
¶
Get the config file path from the environment variable, falling back to our default if it is not set.
get_setting(setting_name, config=None)
¶
Gets the value of the specified setting, returning the default if not configured. Raises an exception if the setting does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
The full setting name, like |
required |
config
|
ConfigParser
|
The config file read with |
None
|
get_setting_default(setting_name, config=None)
¶
Gets the default value for the setting setting_name.
Raises an exception if the setting does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
The full setting name, like |
required |
config
|
Optional[ConfigParser]
|
The config file read with |
None
|
read_config()
¶
If the config hasn't been read yet, or was modified since it was last read, reads the AWS Deadline Cloud configuration.
set_setting(setting_name, value, config=None)
¶
Sets the value of the specified setting, returning the default if not configured. Raises an exception if the setting does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
The full setting name, like |
required |
value
|
bool | int | float | str
|
The value to set. |
required |
config
|
Optional[ConfigParser]
|
If provided sets the setting in the parser and does not save to disk. |
None
|
str2bool(value)
¶
Converts a string to boolean, accepting a variety of on/off, true/false, 0/1 variants.
write_config(config)
¶
Writes the provided config to the AWS Deadline Cloud configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ConfigParser
|
The config object to write. Generally this is
a modified value from what |
required |