New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't unset a boolean from command line or test #20

Closed
moellep opened this Issue Oct 9, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@moellep
Member

moellep commented Oct 9, 2017

sirepo server.py has the config:

oauth_login=(False, bool, 'OAUTH: enable login'),

From the command line, both
export SIREPO_SERVER_OAUTH_LOGIN=0
and
export SIREPO_SERVER_OAUTH_LOGIN=False
result in True values.

Unsetting the value works because False is the default value:
unset SIREPO_SERVER_OAUTH_LOGIN

There would be no way to turn off a value if it has True as the default, for example server.py's enable_source_cache_key.

Possibly related, it isn't possible to turn off a True value from a test, for example, if SIREPO_SERVER_OAUTH_LOGIN=1 in the environment, adding the code below to pkcli/admin_test.py has no effect:

pkconfig.reset_state_for_testing({
'SIREPO_SERVER_OAUTH_LOGIN': False,
})

Instead, the value needed to get set directly:

server.cfg.oauth_login = False

@robnagler robnagler closed this in 7024327 Oct 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment