Skip to content

Commit d9bcdb8

Browse files
committed
Rename environment.get_value_string().
1 parent 01f6362 commit d9bcdb8

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/clusterfuzz/_internal/bot/tasks/utasks/fuzz_task.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,11 +1077,10 @@ def key_fn(crash):
10771077

10781078
def _get_issue_metadata_from_environment(variable_name):
10791079
"""Get issue metadata from environment."""
1080-
values = str(environment.get_value_string(variable_name, '')).split(',')
1080+
values = environment.get_value_raw(variable_name, '').split(',')
10811081
# Allow a variation with a '_1' to specified. This is needed in cases where
10821082
# this is specified in both the job and the bot environment.
1083-
values.extend(
1084-
str(environment.get_value_string(variable_name + '_1', '')).split(','))
1083+
values.extend(environment.get_value_raw(variable_name + '_1', '').split(','))
10851084
return [value.strip() for value in values if value.strip()]
10861085

10871086

src/clusterfuzz/_internal/system/environment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,9 @@ def get_ubsan_disabled_options():
596596
}
597597

598598

599-
def get_value_string(environment_variable, default_value=None):
600-
"""Get environment variable (as a string)."""
601-
return os.getenv(environment_variable, default_value)
599+
def get_value_raw(var: str, default: Optional[str] = None) -> Optional[str]:
600+
"""Returns environment variable `var` directly, without evaluating it."""
601+
return os.environ.get(var, default)
602602

603603

604604
def get_value(environment_variable, default_value=None, env=None):

0 commit comments

Comments
 (0)