Skip to content

Commit

Permalink
Merge pull request #243 from zenotech/iamrole
Browse files Browse the repository at this point in the history
Make ec2 access_key and secrets optional
  • Loading branch information
riccardomurri committed Apr 20, 2016
2 parents a3eae85 + 6908e6f commit cee5b19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions elasticluster/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ def nova_api_version(version):

cloud_schema_ec2 = {"provider": 'ec2_boto',
"ec2_url": Url(str),
"ec2_access_key": All(str, Length(min=1)),
"ec2_secret_key": All(str, Length(min=1)),
Optional("ec2_access_key"): All(str, Length(min=1)),
Optional("ec2_secret_key"): All(str, Length(min=1)),
"ec2_region": All(str, Length(min=1)),
Optional("request_floating_ip"): Boolean(str),
Optional("vpc"): All(str, Length(min=1)),
Expand Down Expand Up @@ -560,8 +560,8 @@ def nova_api_version(version):
"cloud": Schema(
{"provider": Any('ec2_boto', 'google', 'openstack'),
"ec2_url": Url(str),
"ec2_access_key": All(str, Length(min=1)),
"ec2_secret_key": All(str, Length(min=1)),
Optional("ec2_access_key"): All(str, Length(min=1)),
Optional("ec2_secret_key"): All(str, Length(min=1)),
"ec2_region": All(str, Length(min=1)),
"auth_url": All(str, Length(min=1)),
"username": All(str, Length(min=1)),
Expand Down
5 changes: 3 additions & 2 deletions elasticluster/providers/ec2_boto.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ class BotoCloudProvider(AbstractCloudProvider):
"""
__node_start_lock = threading.Lock() # lock used for node startup

def __init__(self, ec2_url, ec2_region, ec2_access_key, ec2_secret_key,
vpc=None, storage_path=None, request_floating_ip=False):
def __init__(self, ec2_url, ec2_region, ec2_access_key=None,
ec2_secret_key=None, vpc=None, storage_path=None,
request_floating_ip=False):
self._url = ec2_url
self._region_name = ec2_region
self._access_key = ec2_access_key
Expand Down

0 comments on commit cee5b19

Please sign in to comment.