Repository: libcloud
Updated Branches:
  refs/heads/trunk 5af1bf363 -> 23d4355a1


Allow user to specify a default_project_id when creating a user.


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

Branch: refs/heads/trunk
Commit: 9910bd5d85db29e79366e010db9685db61d1fa32
Parents: 5af1bf3
Author: Tomaz Muraus <to...@apache.org>
Authored: Thu Aug 14 11:06:44 2014 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Thu Aug 14 11:07:00 2014 +0200

----------------------------------------------------------------------
 libcloud/common/openstack_identity.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/9910bd5d/libcloud/common/openstack_identity.py
----------------------------------------------------------------------
diff --git a/libcloud/common/openstack_identity.py 
b/libcloud/common/openstack_identity.py
index b9723fc..dec8f43 100644
--- a/libcloud/common/openstack_identity.py
+++ b/libcloud/common/openstack_identity.py
@@ -1087,11 +1087,8 @@ class 
OpenStackIdentity_3_0_Connection(OpenStackIdentityConnection):
         response = self.authenticated_request(path, method='DELETE')
         return response.status == httplib.NO_CONTENT
 
-    def create_domain(self):
-        pass
-
     def create_user(self, email, password, name, description=None,
-                    domain_id=None, enabled=True):
+                    domain_id=None, default_project_id=None, enabled=True):
         """
         Create a new user account.
 
@@ -1110,6 +1107,9 @@ class 
OpenStackIdentity_3_0_Connection(OpenStackIdentityConnection):
         :param domain_id: ID of the domain to add the user to (optional).
         :type domain_id: ``str``
 
+        :param default_project_id: ID of the default user project (optional).
+        :type default_project_id: ``str``
+
         :param enabled: True to enable user after creation.
         :type enabled: ``bool``
 
@@ -1129,6 +1129,9 @@ class 
OpenStackIdentity_3_0_Connection(OpenStackIdentityConnection):
         if domain_id:
             data['domain_id'] = domain_id
 
+        if default_project_id:
+            data['default_project_id'] = default_project_id
+
         data = json.dumps({'user': data})
         response = self.authenticated_request('/v3/users', data=data,
                                               method='POST')

Reply via email to