Update resource manager for fixed stevedore issue
Stevedore commit 69e17801a3f0cf37257069da7dc83e2608f31aa5 fixed a known issue in conductor.resource_manager. This patch updates the Ironic code to use stevedore's new accessor. Change-Id: I0f57831a70368afb5ea321c0e607f762d464c2a0
This commit is contained in:
parent
9cb58b4109
commit
34823e35c8
@ -59,19 +59,12 @@ class NodeManager(object):
|
||||
self.node = db.get_node(id)
|
||||
self.ports = db.get_ports_by_node(id)
|
||||
|
||||
def _get_instance(ext, *args, **kwds):
|
||||
return ext.obj
|
||||
|
||||
# NOTE(deva): Driver loading here may get refactored, depend on:
|
||||
# https://github.com/dreamhost/stevedore/issues/15
|
||||
driver_name = self.node.get('driver')
|
||||
try:
|
||||
ref = NodeManager._driver_factory.map(
|
||||
[self.node.get('driver')], _get_instance)
|
||||
self.driver = ref[0]
|
||||
self.driver = NodeManager._driver_factory[driver_name].obj
|
||||
except KeyError:
|
||||
raise exception.IronicException(_(
|
||||
"Failed to load driver %s.") %
|
||||
self.node.get('driver'))
|
||||
"Failed to load driver %s.") % driver_name)
|
||||
|
||||
@classmethod
|
||||
@lockutils.synchronized(RESOURCE_MANAGER_SEMAPHORE, 'ironic-')
|
||||
|
Loading…
Reference in New Issue
Block a user