The freezer_dr.common.utils
Module¶
Utility functions shared from all modules into the project.
-
freezer_dr.common.utils.
get_admin_os_client
()[source]¶ Return admin client data.
Loads credentials from [keystone_authtoken] section in the configuration file and initialize the client with admin privileges and return an instance of the client :return: Initialized instance of OS Client
-
freezer_dr.common.utils.
get_os_client
()[source]¶ Return the OpenStack client.
Loads credentials from [keystone_authtoken] section in the configuration file and initialize the client and return an instance of the client :return: Initialized instance of OS Client
-
freezer_dr.common.utils.
load_jinja_templates
(template_dir, template_name, template_vars)[source]¶ Load and render existing Jinja2 templates.
The main purpose of the function is to prepare the message to be sent and render it for the driver to send it directly.
Parameters: - template_dir – Location where jinja2 templates are stored
- template_name – name of the template to load it
- template_vars – Dict to replace existing vars in the template with values.
Returns: String message