Properly parse boolean env values as boolean (#51836)

This commit is contained in:
Fabian von Feilitzsch 2019-02-11 09:49:00 -05:00 committed by John R Barker
parent 4d3d8dd60f
commit e81b74d6c8

View file

@ -148,6 +148,8 @@ class K8sAnsibleMixin(object):
if auth_params.get(arg) is None:
env_value = os.getenv('K8S_AUTH_{0}'.format(arg.upper()), None)
if env_value is not None:
if AUTH_ARG_SPEC[arg].get('type') == 'bool':
env_value = env_value.lower() not in ['0', 'false', 'no']
auth[arg] = env_value
def auth_set(*names):