← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1308419] Re: requesting empty task list fails when using v2 api with registry

 

Reviewed:  https://review.openstack.org/106012
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=36b502ccdc34a30b4c553d2c398f690b903c469c
Submitter: Jenkins
Branch:    master

commit 36b502ccdc34a30b4c553d2c398f690b903c469c
Author: Stuart McLaren <stuart.mclaren@xxxxxx>
Date:   Thu Jul 10 10:40:56 2014 +0000

    Add task functions to v2 registry
    
    If local changes are made to run the v2 functional
    tests with the v2 registry enabled, and the tests
    are then run with:
    
    $ ./run_tests.sh glance.tests.functional.v2
    
    all tests pass except for 'test_task_lifecycle'.
    
    This test fails because the v2 registry does not define the
    'task_get_all' or 'task_create' functions.
    
    With these defined the tests pass when run with the v2 registry enabled.
    
    This is a prerequisite to running the v2 functional tests with the
    registry enabled.
    
    Change-Id: I588af10105b19087d06f7f13a6f75523595d4a23
    Closes-Bug: 1308419


** Changed in: glance
       Status: Invalid => Fix Committed

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1308419

Title:
  requesting empty task list fails when using v2 api with registry

Status in OpenStack Image Registry and Delivery Service (Glance):
  Fix Committed

Bug description:
  $ ./run_tests.sh --subunit glance.tests.functional.v2.test_tasks.TestTasks.test_task_lifecycle
  Running `tools/with_venv.sh python -m glance.openstack.common.lockutils python setup.py testr --testr-args='--subunit --concurrency 1  --subunit glance.tests.functional.v2.test_tasks.TestTasks.test_task_lifecycle'`
  glance.tests.functional.v2.test_tasks.TestTasks
      test_task_lifecycle                                               FAIL

  Slowest 1 tests took 12.51 secs:
  glance.tests.functional.v2.test_tasks.TestTasks
      test_task_lifecycle                                                   12.51

  ======================================================================
  FAIL: glance.tests.functional.v2.test_tasks.TestTasks.test_task_lifecycle
  ----------------------------------------------------------------------
  Traceback (most recent call last):
  _StringException: Traceback (most recent call last):
    File "/home/ubuntu/glance/glance/tests/functional/v2/test_tasks.py", line 70, in test_task_lifecycle
      self.assertEqual(200, response.status_code)
    File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 321, in assertEqual
      self.assertThat(observed, matcher, message)
    File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 406, in assertThat
      raise mismatch_error
  MismatchError: 200 != 500

  
  Ran 2 tests in 26.697s

  FAILED (failures=1)

  
  2014-04-16 08:56:22,297 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/eventlet/wsgi.py", line 389, in handle_one_response
  2014-04-16 08:56:22,297 INFO result = self.application(self.environ, start_response)
  2014-04-16 08:56:22,297 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
  2014-04-16 08:56:22,297 INFO resp = self.call_func(req, *args, **self.kwargs)
  2014-04-16 08:56:22,297 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
  2014-04-16 08:56:22,297 INFO return self.func(req, *args, **kwargs)
  2014-04-16 08:56:22,297 INFO File "glance/common/wsgi.py", line 378, in __call__
  2014-04-16 08:56:22,297 INFO response = req.get_response(self.application)
  2014-04-16 08:56:22,297 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1320, in send
  2014-04-16 08:56:22,297 INFO application, catch_exc_info=False)
  2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1284, in call_application
  2014-04-16 08:56:22,298 INFO app_iter = application(self.environ, start_response)
  2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
  2014-04-16 08:56:22,298 INFO resp = self.call_func(req, *args, **self.kwargs)
  2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
  2014-04-16 08:56:22,298 INFO return self.func(req, *args, **kwargs)
  2014-04-16 08:56:22,298 INFO File "glance/common/wsgi.py", line 378, in __call__
  2014-04-16 08:56:22,298 INFO response = req.get_response(self.application)
  2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1320, in send
  2014-04-16 08:56:22,298 INFO application, catch_exc_info=False)
  2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1284, in call_application
  2014-04-16 08:56:22,298 INFO app_iter = application(self.environ, start_response)
  2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
  2014-04-16 08:56:22,298 INFO resp = self.call_func(req, *args, **self.kwargs)
  2014-04-16 08:56:22,298 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
  2014-04-16 08:56:22,299 INFO return self.func(req, *args, **kwargs)
  2014-04-16 08:56:22,299 INFO File "glance/common/wsgi.py", line 378, in __call__
  2014-04-16 08:56:22,299 INFO response = req.get_response(self.application)
  2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1320, in send
  2014-04-16 08:56:22,299 INFO application, catch_exc_info=False)
  2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/request.py", line 1284, in call_application
  2014-04-16 08:56:22,299 INFO app_iter = application(self.environ, start_response)
  2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/paste/urlmap.py", line 203, in __call__
  2014-04-16 08:56:22,299 INFO return app(environ, start_response)
  2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
  2014-04-16 08:56:22,299 INFO return resp(environ, start_response)
  2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/routes/middleware.py", line 131, in __call__
  2014-04-16 08:56:22,299 INFO response = self.app(environ, start_response)
  2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
  2014-04-16 08:56:22,299 INFO return resp(environ, start_response)
  2014-04-16 08:56:22,299 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
  2014-04-16 08:56:22,300 INFO resp = self.call_func(req, *args, **self.kwargs)
  2014-04-16 08:56:22,300 INFO File "/home/ubuntu/glance/.venv/local/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
  2014-04-16 08:56:22,300 INFO return self.func(req, *args, **kwargs)
  2014-04-16 08:56:22,300 INFO File "glance/common/wsgi.py", line 644, in __call__
  2014-04-16 08:56:22,300 INFO request, **action_args)
  2014-04-16 08:56:22,300 INFO File "glance/common/wsgi.py", line 668, in dispatch
  2014-04-16 08:56:22,300 INFO return method(*args, **kwargs)
  2014-04-16 08:56:22,300 INFO File "glance/api/v2/tasks.py", line 91, in index
  2014-04-16 08:56:22,300 INFO filters)
  2014-04-16 08:56:22,300 INFO File "glance/api/authorization.py", line 439, in list_tasks
  2014-04-16 08:56:22,300 INFO tasks = self.task_repo.list_tasks(*args, **kwargs)
  2014-04-16 08:56:22,300 INFO File "glance/domain/proxy.py", line 64, in list_tasks
  2014-04-16 08:56:22,300 INFO tasks = self.base.list_tasks(*args, **kwargs)
  2014-04-16 08:56:22,300 INFO File "glance/api/policy.py", line 389, in list_tasks
  2014-04-16 08:56:22,300 INFO return super(TaskRepoProxy, self).list_tasks(*args, **kwargs)
  2014-04-16 08:56:22,300 INFO File "glance/domain/proxy.py", line 64, in list_tasks
  2014-04-16 08:56:22,301 INFO tasks = self.base.list_tasks(*args, **kwargs)
  2014-04-16 08:56:22,301 INFO File "glance/db/__init__.py", line 348, in list_tasks
  2014-04-16 08:56:22,301 INFO db_api_tasks = self.db_api.task_get_all(self.context,
  2014-04-16 08:56:22,301 INFO AttributeError: 'module' object has no attribute 'task_get_all'

  
    67         # Task list should be empty
    68         path = self._url('/v2/tasks')
    69         response = requests.get(path, headers=self._headers())
    70         self.assertEqual(200, response.status_code)

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1308419/+subscriptions


References