mirror of
https://github.com/splunk/security_content
synced 2026-06-08 17:32:49 +00:00
Check for splunkbase_username and splunkbase_password immediately if Splunkbase apps are to be installed and fail with a descriptive error if they are not provided.
This commit is contained in:
@@ -287,6 +287,26 @@ def main(args: list[str]):
|
||||
docker.client.from_env()
|
||||
except Exception as e:
|
||||
print("Error, failed to get docker client. Is Docker Installed and Running?\n\t%s" % (str(e)))
|
||||
|
||||
credentials_needed = False
|
||||
credential_error = False
|
||||
if len(settings['splunkbase_apps']) > 0:
|
||||
credentials_needed = True
|
||||
|
||||
|
||||
if settings['splunkbase_username'] == None and credentials_needed:
|
||||
print("Error - you have listed apps to download from Splunkbase but have "\
|
||||
"not provided --splunkbase_username via the command line or config file.",file=sys.stderr)
|
||||
credential_error = True
|
||||
|
||||
if settings['splunkbase_password'] == None and credentials_needed:
|
||||
print("Error - you have listed apps to download from Splunkbase but have "\
|
||||
"not provided --splunkbase_password via the command line or config file.",file=sys.stderr)
|
||||
credential_error = True
|
||||
|
||||
if credential_error:
|
||||
print("Please supply the required credentials to continue.\n\tQuitting...",file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
FULL_DOCKER_HUB_CONTAINER_NAME = "splunk/splunk:%s" % settings['container_tag']
|
||||
|
||||
Reference in New Issue
Block a user