TypeError for fake_init_exception when running tests

Bug #1284664 reported by Radomir Dopieralski
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Julie Pichon

Bug Description

When running openstack_dashboard tests, this error is displayed twice and ignored (no tests fail):

Error while checking action permissions.
Traceback (most recent call last):
  File "/home/sheep/devel/horizon/horizon/tables/base.py", line 1119, in _filter_action
    return action._allowed(request, datum) and row_matched
  File "/home/sheep/devel/horizon/horizon/tables/actions.py", line 133, in _allowed
    return self.allowed(request, datum)
  File "/home/sheep/devel/horizon/openstack_dashboard/dashboards/project/volumes/volumes/tables.py", line 75, in allowed
    usages = quotas.tenant_quota_usages(request)
  File "/home/sheep/devel/horizon/horizon/utils/memoized.py", line 90, in wrapped
    value = cache[key] = func(*args, **kwargs)
  File "/home/sheep/devel/horizon/openstack_dashboard/usage/quotas.py", line 195, in tenant_quota_usages
    disabled_quotas = get_disabled_quotas(request)
  File "/home/sheep/devel/horizon/openstack_dashboard/usage/quotas.py", line 175, in get_disabled_quotas
    if neutron.is_security_group_extension_supported(request):
  File "/home/sheep/devel/horizon/openstack_dashboard/api/neutron.py", line 861, in is_security_group_extension_supported
    return is_extension_supported(request, 'security-group')
  File "/home/sheep/devel/horizon/horizon/utils/memoized.py", line 90, in wrapped
    value = cache[key] = func(*args, **kwargs)
  File "/home/sheep/devel/horizon/openstack_dashboard/api/neutron.py", line 841, in is_extension_supported
    extensions = list_extensions(request)
  File "/home/sheep/devel/horizon/horizon/utils/memoized.py", line 90, in wrapped
    value = cache[key] = func(*args, **kwargs)
  File "/home/sheep/devel/horizon/openstack_dashboard/api/neutron.py", line 832, in list_extensions
    extensions_list = neutronclient(request).list_extensions()
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 111, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 294, in list_extensions
    return self.get(self.extensions_path, params=_params)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1236, in get
    headers=headers, params=params)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1221, in retry_request
    headers=headers, params=params)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1156, in do_request
    resp, replybody = self.httpclient.do_request(action, method, body=body)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/client.py", line 192, in do_request
    **kwargs)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/client.py", line 154, in _cs_request
    raise exceptions.ConnectionFailed(reason=e)
TypeError: fake_init_exception() takes exactly 3 arguments (1 given)
Error while checking action permissions.
Traceback (most recent call last):
  File "/home/sheep/devel/horizon/horizon/tables/base.py", line 1119, in _filter_action
    return action._allowed(request, datum) and row_matched
  File "/home/sheep/devel/horizon/horizon/tables/actions.py", line 133, in _allowed
    return self.allowed(request, datum)
  File "/home/sheep/devel/horizon/openstack_dashboard/dashboards/project/volumes/volumes/tables.py", line 75, in allowed
    usages = quotas.tenant_quota_usages(request)
  File "/home/sheep/devel/horizon/horizon/utils/memoized.py", line 90, in wrapped
    value = cache[key] = func(*args, **kwargs)
  File "/home/sheep/devel/horizon/openstack_dashboard/usage/quotas.py", line 195, in tenant_quota_usages
    disabled_quotas = get_disabled_quotas(request)
  File "/home/sheep/devel/horizon/openstack_dashboard/usage/quotas.py", line 175, in get_disabled_quotas
    if neutron.is_security_group_extension_supported(request):
  File "/home/sheep/devel/horizon/openstack_dashboard/api/neutron.py", line 861, in is_security_group_extension_supported
    return is_extension_supported(request, 'security-group')
  File "/home/sheep/devel/horizon/horizon/utils/memoized.py", line 90, in wrapped
    value = cache[key] = func(*args, **kwargs)
  File "/home/sheep/devel/horizon/openstack_dashboard/api/neutron.py", line 841, in is_extension_supported
    extensions = list_extensions(request)
  File "/home/sheep/devel/horizon/horizon/utils/memoized.py", line 90, in wrapped
    value = cache[key] = func(*args, **kwargs)
  File "/home/sheep/devel/horizon/openstack_dashboard/api/neutron.py", line 832, in list_extensions
    extensions_list = neutronclient(request).list_extensions()
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 111, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 294, in list_extensions
    return self.get(self.extensions_path, params=_params)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1236, in get
    headers=headers, params=params)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1221, in retry_request
    headers=headers, params=params)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1156, in do_request
    resp, replybody = self.httpclient.do_request(action, method, body=body)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/client.py", line 192, in do_request
    **kwargs)
  File "/home/sheep/devel/horizon/.venv/local/lib/python2.7/site-packages/neutronclient/client.py", line 154, in _cs_request
    raise exceptions.ConnectionFailed(reason=e)
TypeError: fake_init_exception() takes exactly 3 arguments (1 given)

Revision history for this message
Julie Pichon (jpichon) wrote :

Running in verbose mode, we can see this happens for:

test_delete_volume_snapshot (openstack_dashboard.dashboards.project.volumes.snapshots.tests.VolumeSnapshotsViewTests) ... Error while checking action permissions.

test_index (openstack_dashboard.dashboards.project.volumes.test.VolumeAndSnapshotsTests) ... Error while checking action permissions.

Changed in horizon:
status: New → Confirmed
importance: Undecided → Medium
Julie Pichon (jpichon)
Changed in horizon:
milestone: none → icehouse-3
Julie Pichon (jpichon)
Changed in horizon:
assignee: nobody → Julie Pichon (jpichon)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/76511

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

Any idea how the code passed through the gating job?

Revision history for this message
Radomir Dopieralski (deshipu) wrote :

The error is printed and then ignored, so no tests fail.

Revision history for this message
Julie Pichon (jpichon) wrote :

The tests don't fail because we try to catch API errors gracefully in most places (rightly so!). Possibly we should do something to mock the clients in openstack_dashboard.api when running the unit tests, so that if they're ever called directly in a test run they raise an exception...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/76511
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=5bf672facec226c4ad9c37a39455e479d982a2d9
Submitter: Jenkins
Branch: master

commit 5bf672facec226c4ad9c37a39455e479d982a2d9
Author: Julie Pichon <email address hidden>
Date: Wed Feb 26 11:32:17 2014 +0000

    Add missing mocked calls to the Volumes tests

    There is a quota check for the Create Volume button to see if it
    should be enabled. These new calls to tenant_quota_usages were missed
    when the volume snapshots tests moved to the main volumes
    directory/panel.

    Change-Id: If09afd6d69a9a9b14dfb6d802be92b7e24e63c60
    Closes-Bug: #1284664

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.