Add task manager parameter to Connection
TaskManager can be overridden but Connection doesn't currently expose this in the constructor. Change-Id: Iaa17fb40fd2e56eb60d3c3ed227ad82089ce8506
This commit is contained in:
parent
db8b274ca8
commit
97aa69617f
@ -168,7 +168,7 @@ from openstack import config as _config
|
|||||||
from openstack.config import cloud_region
|
from openstack.config import cloud_region
|
||||||
from openstack import exceptions
|
from openstack import exceptions
|
||||||
from openstack import service_description
|
from openstack import service_description
|
||||||
from openstack import task_manager
|
from openstack import task_manager as _task_manager
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'from_config',
|
'from_config',
|
||||||
@ -222,6 +222,7 @@ class Connection(six.with_metaclass(_meta.ConnectionMeta,
|
|||||||
extra_services=None,
|
extra_services=None,
|
||||||
strict=False,
|
strict=False,
|
||||||
use_direct_get=False,
|
use_direct_get=False,
|
||||||
|
task_manager=None,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
"""Create a connection to a cloud.
|
"""Create a connection to a cloud.
|
||||||
|
|
||||||
@ -263,6 +264,15 @@ class Connection(six.with_metaclass(_meta.ConnectionMeta,
|
|||||||
:class:`~openstack.service_description.ServiceDescription`
|
:class:`~openstack.service_description.ServiceDescription`
|
||||||
objects describing services that openstacksdk otherwise does not
|
objects describing services that openstacksdk otherwise does not
|
||||||
know about.
|
know about.
|
||||||
|
:param bool use_direct_get:
|
||||||
|
For get methods, make specific REST calls for server-side
|
||||||
|
filtering instead of making list calls and filtering client-side.
|
||||||
|
Default false.
|
||||||
|
:param task_manager:
|
||||||
|
Task Manager to handle the execution of remote REST calls.
|
||||||
|
Defaults to None which causes a direct-action Task Manager to be
|
||||||
|
used.
|
||||||
|
:type manager: :class:`~openstack.task_manager.TaskManager`
|
||||||
:param kwargs: If a config is not provided, the rest of the parameters
|
:param kwargs: If a config is not provided, the rest of the parameters
|
||||||
provided are assumed to be arguments to be passed to the
|
provided are assumed to be arguments to be passed to the
|
||||||
CloudRegion contructor.
|
CloudRegion contructor.
|
||||||
@ -295,7 +305,8 @@ class Connection(six.with_metaclass(_meta.ConnectionMeta,
|
|||||||
load_envvars=cloud is not None,
|
load_envvars=cloud is not None,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
self.task_manager = task_manager.TaskManager(self.config.full_name)
|
self.task_manager = task_manager or _task_manager.TaskManager(
|
||||||
|
self.config.full_name)
|
||||||
|
|
||||||
self._session = None
|
self._session = None
|
||||||
self._proxies = {}
|
self._proxies = {}
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
A new ``task_manager`` parameter to ``Connection`` has been added for
|
||||||
|
passing a TaskManager object. This was present in shade and is used by
|
||||||
|
nodepool, but was missing from the Connection constructor.
|
Loading…
x
Reference in New Issue
Block a user