]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat : allow boto_client to accept credentials
authorSteven Hardy <shardy@redhat.com>
Tue, 11 Sep 2012 18:07:00 +0000 (19:07 +0100)
committerSteven Hardy <shardy@redhat.com>
Tue, 11 Sep 2012 18:07:00 +0000 (19:07 +0100)
Allow ec2 credentials to optionally be passed in to boto
rather than purely relying on config-files

Change-Id: Ib821f2bca9bc3f61af521955a9ed52f0059e70e4
Signed-off-by: Steven Hardy <shardy@redhat.com>
heat/boto_client.py

index d2de0000779f249fa6ddf7cae580325a6e6c03bd..9a61111e70308f6361d25093d012919bbca42703 100644 (file)
@@ -274,17 +274,19 @@ def get_client(host, port=None, username=None,
                password=None, tenant=None,
                auth_url=None, auth_strategy=None,
                auth_token=None, region=None,
-               is_silent_upload=False, insecure=True):
+               is_silent_upload=False, insecure=True,
+               aws_access_key=None, aws_secret_key=None):
 
     """
     Returns a new boto Cloudformation client connection to a heat server
     """
 
-    # Note we pass None/None for the keys so boto reads /etc/boto.cfg
+    # Note we pass None/None for the keys by default
+    # This means boto reads /etc/boto.cfg, or ~/.boto
     # Also note is_secure is defaulted to False as HTTPS connections
     # don't seem to work atm, FIXME
-    cloudformation = BotoClient(aws_access_key_id=None,
-        aws_secret_access_key=None, is_secure=False,
+    cloudformation = BotoClient(aws_access_key_id=aws_access_key,
+        aws_secret_access_key=aws_secret_key, is_secure=False,
         port=port, path="/v1")
     if cloudformation:
         logger.debug("Got CF connection object OK")