You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
click.echo("Credentials not found.\nYou can set them in ~/.aws/credentials or by setting environment variables.\nSee https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#environment-variables for more info.")
90
-
click.echo("Exiting...")
91
-
exit()
89
+
# Check if Zappa has already been run
90
+
ifos.path.isfile('zappa_settings.json'):
91
+
92
+
# Check from settings if Zappadock should use environment variables or credentials file
93
+
withopen('zappa_settings.json') asf:
94
+
# Try to get 'profile_name' from settings
95
+
try:
96
+
_=list(json.load(f).values())[0]['profile_name']
97
+
creds_type='file'
98
+
99
+
# File exists but no profile name is set
100
+
exceptKeyError:
101
+
creds_type='env'
102
+
103
+
# File exists but there are no settings or invalid JSON
click.echo("Credentials not found.\nYou can set them in ~/.aws/credentials or by setting environment variables.\nSee https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#environment-variables for more info.")
0 commit comments