mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Merge pull request #116 from rybaktomasz/aws-credentials
Do not require AWS credentials in manifest file
This commit is contained in:
commit
8e9c94567e
1 changed files with 9 additions and 0 deletions
|
@ -29,6 +29,15 @@ class GetCredentials(Task):
|
||||||
for key in keys:
|
for key in keys:
|
||||||
creds[key] = getenv(env_key(key))
|
creds[key] = getenv(env_key(key))
|
||||||
return creds
|
return creds
|
||||||
|
|
||||||
|
def provider_key(key):
|
||||||
|
return key.replace('-', '_')
|
||||||
|
import boto.provider
|
||||||
|
provider = boto.provider.Provider('aws')
|
||||||
|
if all(getattr(provider, provider_key(key)) is not None for key in keys):
|
||||||
|
for key in keys:
|
||||||
|
creds[key] = getattr(provider, provider_key(key))
|
||||||
|
return creds
|
||||||
raise RuntimeError(('No ec2 credentials found, they must all be specified '
|
raise RuntimeError(('No ec2 credentials found, they must all be specified '
|
||||||
'exclusively via environment variables or through the manifest.'))
|
'exclusively via environment variables or through the manifest.'))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue