~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to ironic/tests/conductor/utils.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-01-05 12:21:37 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20150105122137-171bqrdpcxqipunk
Tags: 2015.1~b1-0ubuntu1
* New upstream beta release:
  - d/control: Align version requirements with upstream release.
* d/watch: Update uversionmangle to deal with kilo beta versioning
  changes.
* d/control: Bumped Standards-Version to 3.9.6, no changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Test utils for Ironic Managers."""
19
19
 
20
 
from ironic.common import driver_factory
21
20
import pkg_resources
22
21
from stevedore import dispatch
23
22
 
 
23
from ironic.common import driver_factory
 
24
 
24
25
 
25
26
def mock_the_extension_manager(driver="fake", namespace="ironic.drivers"):
26
27
    """Get a fake stevedore NameDispatchExtensionManager instance.
43
44
    #                    instantiaing a DriverFactory class to avoid
44
45
    #                    a real NameDispatchExtensionManager to be created
45
46
    #                    with the real namespace.
46
 
    driver_factory.DriverFactory._extension_manager = \
47
 
            dispatch.NameDispatchExtensionManager('ironic.no-such-namespace',
48
 
                                                  lambda x: True)
 
47
    driver_factory.DriverFactory._extension_manager = (
 
48
        dispatch.NameDispatchExtensionManager('ironic.no-such-namespace',
 
49
                                              lambda x: True))
49
50
    mock_ext_mgr = driver_factory.DriverFactory()
50
51
    mock_ext = mock_ext_mgr._extension_manager._load_one_plugin(
51
52
                                              entry_point, True, [], {}, False)