diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2010-12-29 17:40:18 -0600 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2010-12-29 17:40:18 -0600 |
| commit | be6750a77e5121fe8f0d95016da4e96c9de3b5aa (patch) | |
| tree | b8eb40665b5692e3d6b83b2598973c4e630cf8f9 | |
| parent | aac25e8cc6e75d5d0abc41a8cf979300e58bcc3b (diff) | |
removed lock check from show and changed returning 404 to 405
| -rw-r--r-- | nova/api/openstack/servers.py | 3 | ||||
| -rw-r--r-- | nova/tests/api/openstack/test_servers.py | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 74b4f55b5..24fd5000c 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -66,7 +66,7 @@ def checks_instance_lock(function): if admin or not locked: return function(*args, **kwargs) - return faults.Fault(exc.HTTPNotFound()) + return faults.Fault(exc.HTTPMethodNotAllowed()) return decorated_function @@ -138,7 +138,6 @@ class Controller(wsgi.Controller): res = [entity_maker(inst)['server'] for inst in limited_list] return dict(servers=res) - @checks_instance_lock def show(self, req, id): """ Returns server details by server id """ try: diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py index a122f3946..56a5a9b27 100644 --- a/nova/tests/api/openstack/test_servers.py +++ b/nova/tests/api/openstack/test_servers.py @@ -340,7 +340,7 @@ class ServersTest(unittest.TestCase): res = req.get_response(nova.api.API('os')) # expect a 404 since it was locked - self.assertEqual(res.status_int, 404) + self.assertEqual(res.status_int, 405) # Part two: stubs it to be unlocked and test pause def get_unlocked(self, context, id): |
