diff --git a/gitlab/config.py b/gitlab/config.py index 67f508229..09732bb40 100644 --- a/gitlab/config.py +++ b/gitlab/config.py @@ -36,9 +36,7 @@ def _env_config() -> List[str]: HELPER_PREFIX = "helper:" -HELPER_ATTRIBUTES = [ - "job_token", "http_password", "private_token", "oauth_token" -] +HELPER_ATTRIBUTES = ["job_token", "http_password", "private_token", "oauth_token"] class ConfigError(Exception): pass @@ -202,11 +200,11 @@ def __init__( pass def _get_values_from_helper(self): - """Update attributes, which may get values from an external helper program - """ + """Update attributes, which may get values from an external helper program""" for attr in HELPER_ATTRIBUTES: value = getattr(self, attr) - if isinstance(value, str) and value.lower().strip().startswith(HELPER_PREFIX): + _value_lower = value.lower().strip() + if isinstance(value, str) and _value_lower.startswith(HELPER_PREFIX): helper = value[len(HELPER_PREFIX) :].strip() value = subprocess.check_output([helper]).decode("utf-8").strip() setattr(self, attr, value) \ No newline at end of file