Set an environment variable.
(environment_variable, value, env=None)
| 1070 | |
| 1071 | |
| 1072 | def set_value(environment_variable, value, env=None): |
| 1073 | """Set an environment variable.""" |
| 1074 | if env is None: |
| 1075 | env = os.environ |
| 1076 | value_str = str(value) |
| 1077 | environment_variable_str = str(environment_variable) |
| 1078 | value_str = value_str.replace('%ROOT_DIR%', os.getenv('ROOT_DIR', '')) |
| 1079 | env[environment_variable_str] = value_str |
| 1080 | |
| 1081 | if is_trusted_host(): |
| 1082 | from clusterfuzz._internal.bot.untrusted_runner import \ |
| 1083 | environment as untrusted_env |
| 1084 | untrusted_env.forward_environment_variable(environment_variable_str, |
| 1085 | value_str) |
| 1086 | |
| 1087 | |
| 1088 | def get_initial_task_name(): |
no test coverage detected