diff --git a/api_client/python/timesketch_api_client/config.py b/api_client/python/timesketch_api_client/config.py index 5b69f54a1e..26a1316e09 100644 --- a/api_client/python/timesketch_api_client/config.py +++ b/api_client/python/timesketch_api_client/config.py @@ -21,6 +21,7 @@ import configparser import logging import os +import sys import requests from google.auth.transport import requests as auth_requests @@ -493,6 +494,15 @@ def configure_missing_parameters( """ just_configured = [] + if config_assistant.missing: + if not sys.stdout.isatty() or not sys.stdin.isatty(): + msg = ( + "You will be asked to provide config values, but the session" + " doesn't have a tty. Please set up your config file, or " + "rerun in a tty." + ) + raise RuntimeError(msg) + for field in config_assistant.missing: hint = config_assistant.CONFIG_HINTS.get(field, "") value = cli_input.ask_question(