diff options
author | Devin Carlen <devin.carlen@gmail.com> | 2011-01-28 22:40:41 -0800 |
---|---|---|
committer | Devin Carlen <devin.carlen@gmail.com> | 2011-01-28 22:40:41 -0800 |
commit | 54779a3db8af199f4b72043aa7c1bed208fefd88 (patch) | |
tree | 1bc753638a125108943bf0ae75eff76494cfcd73 | |
parent | 396b02f876030f1f54b7af32cf94fccbbe1fe46b (diff) | |
download | nova-54779a3db8af199f4b72043aa7c1bed208fefd88.tar.gz nova-54779a3db8af199f4b72043aa7c1bed208fefd88.tar.xz nova-54779a3db8af199f4b72043aa7c1bed208fefd88.zip |
Added modify project to ec2 admin api
-rw-r--r-- | nova/adminclient.py | 7 | ||||
-rw-r--r-- | nova/api/ec2/admin.py | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/nova/adminclient.py b/nova/adminclient.py index 3cdd8347f..64ebdb4d9 100644 --- a/nova/adminclient.py +++ b/nova/adminclient.py @@ -376,6 +376,13 @@ class NovaAdminClient(object): 'MemberUsers': member_users} return self.apiconn.get_object('RegisterProject', params, ProjectInfo) + def modify_project(self, projectname, manager_user=None, description=None): + """Modifies an existing project.""" + params = {'Name': projectname, + 'ManagerUser': manager_user, + 'Description': description} + return self.apiconn.get_status('ModifyProject', params) + def delete_project(self, projectname): """Permanently deletes the specified project.""" return self.apiconn.get_object('DeregisterProject', diff --git a/nova/api/ec2/admin.py b/nova/api/ec2/admin.py index d7e899d12..735951082 100644 --- a/nova/api/ec2/admin.py +++ b/nova/api/ec2/admin.py @@ -184,6 +184,17 @@ class AdminController(object): description=None, member_users=None)) + def modify_project(self, context, name, manager_user, description=None, + **kwargs): + """Modifies a project""" + msg = _("Modify project: %(name)s managed by" + " %(manager_user)s") % locals() + LOG.audit(msg, context=context) + manager.AuthManager().modify_project(name, + manager_user=manager_user, + description=description) + return True + def deregister_project(self, context, name): """Permanently deletes a project.""" LOG.audit(_("Delete project: %s"), name, context=context) |