diff options
| author | Monsyne Dragon <mdragon@rackspace.com> | 2011-03-10 22:14:53 +0000 |
|---|---|---|
| committer | Monsyne Dragon <mdragon@rackspace.com> | 2011-03-10 22:14:53 +0000 |
| commit | be66b329d5b94ffbfb782355ef342eadbaed72a5 (patch) | |
| tree | 5d23e1bccc5d52cee5acf7fe3c1ddcee60329d12 /nova/api | |
| parent | 9f1847ca334b3a35130d3f6113808d7b2a949877 (diff) | |
| download | nova-be66b329d5b94ffbfb782355ef342eadbaed72a5.tar.gz nova-be66b329d5b94ffbfb782355ef342eadbaed72a5.tar.xz nova-be66b329d5b94ffbfb782355ef342eadbaed72a5.zip | |
Fix a fer nits jaypipes found in review.
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/accounts.py | 18 | ||||
| -rw-r--r-- | nova/api/openstack/users.py | 4 |
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")) |
