libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject git commit: Allow passing `credential_file` to be used in the GCEConnection
Date Mon, 20 Oct 2014 06:51:11 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 75bc68c66 -> 39d9f6081


Allow passing `credential_file` to be used in the GCEConnection

Closes #359

Signed-off-by: Tomaz Muraus <tomaz@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/39d9f608
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/39d9f608
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/39d9f608

Branch: refs/heads/trunk
Commit: 39d9f6081642d6a5321f34c6c5363a621fd6f711
Parents: 75bc68c
Author: Pedro Algarvio <pedro@algarvio.me>
Authored: Sat Sep 13 17:43:22 2014 +0100
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Mon Oct 20 14:50:49 2014 +0800

----------------------------------------------------------------------
 libcloud/compute/drivers/gce.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/39d9f608/libcloud/compute/drivers/gce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 856c334..7255755 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -551,7 +551,7 @@ class GCENodeDriver(NodeDriver):
     }
 
     def __init__(self, user_id, key, datacenter=None, project=None,
-                 auth_type=None, scopes=None, **kwargs):
+                 auth_type=None, scopes=None, credential_file=None, **kwargs):
         """
         :param  user_id: The email address (for service accounts) or Client ID
                          (for installed apps) to be used for authentication.
@@ -578,10 +578,16 @@ class GCENodeDriver(NodeDriver):
         :keyword  scopes: List of authorization URLs. Default is empty and
                           grants read/write to Compute, Storage, DNS.
         :type     scopes: ``list``
+
+        :keyword  credential_file: Path to file for caching authentication
+                                   information used by GCEConnection
+        :type     credential_file: ``str``
+
         """
         self.auth_type = auth_type
         self.project = project
         self.scopes = scopes
+        self.credential_file = credential_file
         if not self.project:
             raise ValueError('Project name must be specified using '
                              '"project" keyword.')
@@ -2749,7 +2755,8 @@ class GCENodeDriver(NodeDriver):
     def _ex_connection_class_kwargs(self):
         return {'auth_type': self.auth_type,
                 'project': self.project,
-                'scopes': self.scopes}
+                'scopes': self.scopes,
+                'credential_file': self.credential_file}
 
     def _catch_error(self, ignore_errors=False):
         """


Mime
View raw message