nova.tests.api.ec2.test_cloud is missing consoleauth_manager import

Bug #1276398 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matt Riedemann

Bug Description

If you run nova unit tests outside of a virtualenv, like with using nosetests on python 2.6 (which should be supported but not really enforced), then the ec2 test_cloud test fails due to not having the consoleauth_manager config option in scope:

Traceback (most recent call last):
  File "/root/nova/nova/tests/api/ec2/test_cloud.py", line 178, in setUp
    self.consoleauth = self.start_service('consoleauth')
  File "/root/nova/nova/test.py", line 295, in start_service
    svc = self.useFixture(ServiceFixture(name, host, **kwargs))
  File "/usr/lib/python2.6/site-packages/testtools/testcase.py", line 628, in useFixture
    fixture.setUp()
  File "/root/nova/nova/test.py", line 174, in setUp
    self.service = service.Service.create(**self.kwargs)
  File "/root/nova/nova/service.py", line 272, in create
    manager = CONF.get(manager_cls, None)
  File "/usr/lib64/python2.6/_abcoll.py", line 336, in get
    return self[key]
  File "/usr/lib/python2.6/site-packages/oslo/config/cfg.py", line 1626, in __getitem__
    return self.__getattr__(key)
  File "/usr/lib/python2.6/site-packages/oslo/config/cfg.py", line 1622, in __getattr__
    raise NoSuchOptError(name)
NoSuchOptError: no such option: consoleauth_manager

There is a mailing list thread related to this, but not for ec2:

http://lists.openstack.org/pipermail/openstack-dev/2013-September/014896.html

Simply importing this fixes the problem:

CONF.import_opt('consoleauth_manager', 'nova.consoleauth.manager')

Tags: ec2 testing
Revision history for this message
Matt Riedemann (mriedem) wrote :

Grepping the code for "self.start_service('consoleauth')" it also shows up in:

integrated_helpers.py - nova/nova/tests/integrated
test_cinder_cloud.py - nova/nova/tests/api/ec2

But there is no import for consoleauth_manager, so those should also be fixed. integrated_helpers.py is where Andrea was hitting this in the mailing list.

Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Matt Riedemann (mriedem) wrote :
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/71184
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c94b71c2d42a651f3b24d5f0ac1819bfa2a79a12
Submitter: Jenkins
Branch: master

commit c94b71c2d42a651f3b24d5f0ac1819bfa2a79a12
Author: Matt Riedemann <email address hidden>
Date: Tue Feb 4 19:04:18 2014 -0800

    Move consoleauth_manager option into nova.service and fix imports

    Moves the consoleauth_manager option into nova.service like the other
    manager options in commit 39ce4032.

    The thinking for having it in nova.service is that's where
    CONF.get('%_manager'...) is called. It also makes no sense for the
    option to be declared in nova.consoleauth.manager because if you change
    this config option, then you don't want nova.consoleauth.manager loaded.

    Closes-Bug: #1276398

    Change-Id: I85e089239228920e9e58284cf6ff52e43bf85ab0

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
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.