setup_yaml_for_env_vars()
Configures the YAML Loader to do replacement of environment variables.
It will replace YAML value strings such as '${HOST}' and '${PORT:80}' with environment
variable lookups.
In the first example, '${HOST}', it will replace the string with the value from doing
os.getenv("HOST")
. If the environment variable 'HOST" is not set, an exception will be thrown.
In the second example, '${PORT:80}', we are doing the same but looking up `os.getenv("PORT"). In this case,
if the 'PORT' environment variable is not set, it will use the default value shows, which in this case is '80'.
Source code in wiseagents/yaml/wise_yaml_loader.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|