Refactor function parent_get_oauth_secret

Make function much more compact. Move pylint:disable directive into the block
where it is actually needed, rather than applying the directive to the entire
function.