summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/accounts.py18
-rw-r--r--nova/api/openstack/users.py4
2 files changed, 17 insertions, 5 deletions
diff --git a/nova/api/openstack/accounts.py b/nova/api/openstack/accounts.py
index 3b90d2776..dd88c3390 100644
--- a/nova/api/openstack/accounts.py
+++ b/nova/api/openstack/accounts.py
@@ -21,6 +21,7 @@ from nova import log as logging
from nova import wsgi
from nova.auth import manager
+from nova.api.openstack import faults
FLAGS = flags.FLAGS
LOG = logging.getLogger('nova.api.openstack')
@@ -44,11 +45,17 @@ class Controller(wsgi.Controller):
self.manager = manager.AuthManager()
def _check_admin(self, context):
- """ We cannot depend on the db layer to check for admin access
- for the auth manager, so we do it here """
+ """We cannot depend on the db layer to check for admin access
+ for the auth manager, so we do it here"""
if not context.is_admin:
raise exception.NotAuthorized(_("Not admin user."))
+ def index(self, req):
+ raise faults.Fault(exc.HTTPNotImplemented())
+
+ def detail(self, req):
+ raise faults.Fault(exc.HTTPNotImplemented())
+
def show(self, req, id):
"""Return data about the given account id"""
account = self.manager.get_project(id)
@@ -59,8 +66,13 @@ class Controller(wsgi.Controller):
self.manager.delete_project(id)
return {}
+ def create(self, req):
+ """We use update with create-or-update semantics
+ because the id comes from an external source"""
+ raise faults.Fault(exc.HTTPNotImplemented())
+
def update(self, req, id):
- """ This is really create or update. """
+ """This is really create or update."""
self._check_admin(req.environ['nova.context'])
env = self._deserialize(req.body, req)
description = env['account'].get('description')
diff --git a/nova/api/openstack/users.py b/nova/api/openstack/users.py
index 83ebec964..5bb20a718 100644
--- a/nova/api/openstack/users.py
+++ b/nova/api/openstack/users.py
@@ -45,8 +45,8 @@ class Controller(wsgi.Controller):
self.manager = manager.AuthManager()
def _check_admin(self, context):
- """ We cannot depend on the db layer to check for admin access
- for the auth manager, so we do it here """
+ """We cannot depend on the db layer to check for admin access
+ for the auth manager, so we do it here"""
if not context.is_admin:
raise exception.NotAuthorized(_("Not admin user"))