Merge lp:~devcamcar/nova/lp709632 into lp:~hudson-openstack/nova/trunk

Proposed by Devin Carlen
Status: Merged
Approved by: Devin Carlen
Approved revision: 639
Merged at revision: 641
Proposed branch: lp:~devcamcar/nova/lp709632
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 39 lines (+18/-0)
2 files modified
nova/adminclient.py (+7/-0)
nova/api/ec2/admin.py (+11/-0)
To merge this branch: bzr merge lp:~devcamcar/nova/lp709632
Reviewer Review Type Date Requested Status
Thierry Carrez (community) gfe Approve
Vish Ishaya (community) Approve
Rick Harris (community) Approve
Review via email: mp+48040@code.launchpad.net

Commit message

Enabled modification of projects using the EC2 admin API.

Description of the change

Enables modification of projects using the EC2 admin API. All the interesting bits are already in the auth manager. This just exposes the methods over the admin API.

This change has very low impact, but these changes are high priority for the openstack-dashboard.

I am requesting a feature freeze exception for this patch.

To post a comment you must log in.
Revision history for this message
Rick Harris (rconradharris) wrote :

Looks reasonable

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm

review: Approve
Revision history for this message
Thierry Carrez (ttx) wrote :

Very self-contained, exception granted

review: Approve (gfe)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/adminclient.py'
2--- nova/adminclient.py 2011-01-30 23:45:17 +0000
3+++ nova/adminclient.py 2011-01-31 19:42:34 +0000
4@@ -381,6 +381,13 @@
5 'MemberUsers': member_users}
6 return self.apiconn.get_object('RegisterProject', params, ProjectInfo)
7
8+ def modify_project(self, projectname, manager_user=None, description=None):
9+ """Modifies an existing project."""
10+ params = {'Name': projectname,
11+ 'ManagerUser': manager_user,
12+ 'Description': description}
13+ return self.apiconn.get_status('ModifyProject', params)
14+
15 def delete_project(self, projectname):
16 """Permanently deletes the specified project."""
17 return self.apiconn.get_object('DeregisterProject',
18
19=== modified file 'nova/api/ec2/admin.py'
20--- nova/api/ec2/admin.py 2011-01-26 00:40:23 +0000
21+++ nova/api/ec2/admin.py 2011-01-31 19:42:34 +0000
22@@ -184,6 +184,17 @@
23 description=None,
24 member_users=None))
25
26+ def modify_project(self, context, name, manager_user, description=None,
27+ **kwargs):
28+ """Modifies a project"""
29+ msg = _("Modify project: %(name)s managed by"
30+ " %(manager_user)s") % locals()
31+ LOG.audit(msg, context=context)
32+ manager.AuthManager().modify_project(name,
33+ manager_user=manager_user,
34+ description=description)
35+ return True
36+
37 def deregister_project(self, context, name):
38 """Permanently deletes a project."""
39 LOG.audit(_("Delete project: %s"), name, context=context)