Merge "Use connect_retries when creating clients" into stable/rocky
This commit is contained in:
commit
06f8ee5524
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
from aodhclient import client as ac
|
from aodhclient import client as ac
|
||||||
from aodhclient import exceptions
|
from aodhclient import exceptions
|
||||||
|
from oslo_config import cfg
|
||||||
|
|
||||||
from heat.engine.clients import client_plugin
|
from heat.engine.clients import client_plugin
|
||||||
|
|
||||||
|
@ -37,6 +38,7 @@ class AodhClientPlugin(client_plugin.ClientPlugin):
|
||||||
session=self.context.keystone_session,
|
session=self.context.keystone_session,
|
||||||
interface=interface,
|
interface=interface,
|
||||||
service_type=self.ALARMING,
|
service_type=self.ALARMING,
|
||||||
|
connect_retries=cfg.CONF.client_retry_limit,
|
||||||
region_name=self._get_region_name())
|
region_name=self._get_region_name())
|
||||||
|
|
||||||
def is_not_found(self, ex):
|
def is_not_found(self, ex):
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
from barbicanclient import exceptions
|
from barbicanclient import exceptions
|
||||||
from barbicanclient.v1 import client as barbican_client
|
from barbicanclient.v1 import client as barbican_client
|
||||||
from barbicanclient.v1 import containers
|
from barbicanclient.v1 import containers
|
||||||
|
from oslo_config import cfg
|
||||||
|
|
||||||
from heat.common import exception
|
from heat.common import exception
|
||||||
from heat.engine.clients import client_plugin
|
from heat.engine.clients import client_plugin
|
||||||
|
@ -33,6 +34,7 @@ class BarbicanClientPlugin(client_plugin.ClientPlugin):
|
||||||
session=self.context.keystone_session,
|
session=self.context.keystone_session,
|
||||||
service_type=self.KEY_MANAGER,
|
service_type=self.KEY_MANAGER,
|
||||||
interface=interface,
|
interface=interface,
|
||||||
|
connect_retries=cfg.CONF.client_retry_limit,
|
||||||
region_name=self._get_region_name())
|
region_name=self._get_region_name())
|
||||||
return client
|
return client
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
from blazarclient import client as blazar_client
|
from blazarclient import client as blazar_client
|
||||||
from keystoneauth1.exceptions import http as ks_exc
|
from keystoneauth1.exceptions import http as ks_exc
|
||||||
|
from oslo_config import cfg
|
||||||
|
|
||||||
from heat.engine.clients import client_plugin
|
from heat.engine.clients import client_plugin
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ class BlazarClientPlugin(client_plugin.ClientPlugin):
|
||||||
'service_type': self.RESERVATION,
|
'service_type': self.RESERVATION,
|
||||||
'interface': interface,
|
'interface': interface,
|
||||||
'region_name': self._get_region_name(),
|
'region_name': self._get_region_name(),
|
||||||
|
'connect_retries': cfg.CONF.client_retry_limit
|
||||||
}
|
}
|
||||||
|
|
||||||
client = blazar_client.Client(**args)
|
client = blazar_client.Client(**args)
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
from cinderclient import client as cc
|
from cinderclient import client as cc
|
||||||
from cinderclient import exceptions
|
from cinderclient import exceptions
|
||||||
from keystoneauth1 import exceptions as ks_exceptions
|
from keystoneauth1 import exceptions as ks_exceptions
|
||||||
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from heat.common import exception
|
from heat.common import exception
|
||||||
|
@ -62,6 +63,7 @@ class CinderClientPlugin(client_plugin.ClientPlugin):
|
||||||
'interface': self.interface,
|
'interface': self.interface,
|
||||||
'service_type': self.service_type,
|
'service_type': self.service_type,
|
||||||
'region_name': self._get_region_name(),
|
'region_name': self._get_region_name(),
|
||||||
|
'connect_retries': cfg.CONF.client_retry_limit,
|
||||||
'http_log_debug': self._get_client_option(CLIENT_NAME,
|
'http_log_debug': self._get_client_option(CLIENT_NAME,
|
||||||
'http_log_debug')
|
'http_log_debug')
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from oslo_config import cfg
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
|
|
||||||
from glanceclient import client as gc
|
from glanceclient import client as gc
|
||||||
|
@ -41,6 +42,7 @@ class GlanceClientPlugin(client_plugin.ClientPlugin):
|
||||||
return gc.Client(version, session=con.keystone_session,
|
return gc.Client(version, session=con.keystone_session,
|
||||||
interface=interface,
|
interface=interface,
|
||||||
service_type=self.IMAGE,
|
service_type=self.IMAGE,
|
||||||
|
connect_retries=cfg.CONF.client_retry_limit,
|
||||||
region_name=self._get_region_name())
|
region_name=self._get_region_name())
|
||||||
|
|
||||||
def _find_with_attr(self, entity, **kwargs):
|
def _find_with_attr(self, entity, **kwargs):
|
||||||
|
|
|
@ -38,6 +38,7 @@ class HeatClientPlugin(client_plugin.ClientPlugin):
|
||||||
args['username'] = self.context.username
|
args['username'] = self.context.username
|
||||||
args['password'] = self.context.password
|
args['password'] = self.context.password
|
||||||
|
|
||||||
|
args['connect_retries'] = cfg.CONF.client_retry_limit
|
||||||
return hc.Client('1', endpoint_override=endpoint,
|
return hc.Client('1', endpoint_override=endpoint,
|
||||||
session=self.context.keystone_session,
|
session=self.context.keystone_session,
|
||||||
**args)
|
**args)
|
||||||
|
|
|
@ -152,12 +152,14 @@ class KsClientWrapper(object):
|
||||||
self._domain_admin_client = kc_v3.Client(
|
self._domain_admin_client = kc_v3.Client(
|
||||||
session=self.session,
|
session=self.session,
|
||||||
auth=self.domain_admin_auth,
|
auth=self.domain_admin_auth,
|
||||||
|
connect_retries=cfg.CONF.client_retry_limit,
|
||||||
region_name=self.region_name)
|
region_name=self.region_name)
|
||||||
|
|
||||||
return self._domain_admin_client
|
return self._domain_admin_client
|
||||||
|
|
||||||
def _v3_client_init(self):
|
def _v3_client_init(self):
|
||||||
client = kc_v3.Client(session=self.session,
|
client = kc_v3.Client(session=self.session,
|
||||||
|
connect_retries=cfg.CONF.client_retry_limit,
|
||||||
region_name=self.region_name)
|
region_name=self.region_name)
|
||||||
|
|
||||||
if hasattr(self.context.auth_plugin, 'get_access'):
|
if hasattr(self.context.auth_plugin, 'get_access'):
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
from magnumclient import exceptions as mc_exc
|
from magnumclient import exceptions as mc_exc
|
||||||
from magnumclient.v1 import client as magnum_client
|
from magnumclient.v1 import client as magnum_client
|
||||||
|
from oslo_config import cfg
|
||||||
|
|
||||||
from heat.common import exception
|
from heat.common import exception
|
||||||
from heat.engine.clients import client_plugin
|
from heat.engine.clients import client_plugin
|
||||||
|
@ -31,6 +32,7 @@ class MagnumClientPlugin(client_plugin.ClientPlugin):
|
||||||
'interface': interface,
|
'interface': interface,
|
||||||
'service_type': self.CONTAINER,
|
'service_type': self.CONTAINER,
|
||||||
'session': self.context.keystone_session,
|
'session': self.context.keystone_session,
|
||||||
|
'connect_retries': cfg.CONF.client_retry_limit,
|
||||||
'region_name': self._get_region_name()
|
'region_name': self._get_region_name()
|
||||||
}
|
}
|
||||||
client = magnum_client.Client(**args)
|
client = magnum_client.Client(**args)
|
||||||
|
|
|
@ -16,6 +16,7 @@ from heat.engine.clients import client_plugin
|
||||||
from heat.engine import constraints
|
from heat.engine import constraints
|
||||||
from manilaclient import client as manila_client
|
from manilaclient import client as manila_client
|
||||||
from manilaclient import exceptions
|
from manilaclient import exceptions
|
||||||
|
from oslo_config import cfg
|
||||||
|
|
||||||
MANILACLIENT_VERSION = "2"
|
MANILACLIENT_VERSION = "2"
|
||||||
CLIENT_NAME = 'manila'
|
CLIENT_NAME = 'manila'
|
||||||
|
@ -33,6 +34,7 @@ class ManilaClientPlugin(client_plugin.ClientPlugin):
|
||||||
'endpoint_type': endpoint_type,
|
'endpoint_type': endpoint_type,
|
||||||
'service_type': self.SHARE,
|
'service_type': self.SHARE,
|
||||||
'session': self.context.keystone_session,
|
'session': self.context.keystone_session,
|
||||||
|
'connect_retries': cfg.CONF.client_retry_limit,
|
||||||
'region_name': self._get_region_name()
|
'region_name': self._get_region_name()
|
||||||
}
|
}
|
||||||
client = manila_client.Client(MANILACLIENT_VERSION, **args)
|
client = manila_client.Client(MANILACLIENT_VERSION, **args)
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
from neutronclient.common import exceptions
|
from neutronclient.common import exceptions
|
||||||
from neutronclient.neutron import v2_0 as neutronV20
|
from neutronclient.neutron import v2_0 as neutronV20
|
||||||
from neutronclient.v2_0 import client as nc
|
from neutronclient.v2_0 import client as nc
|
||||||
|
from oslo_config import cfg
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
|
|
||||||
from heat.common import exception
|
from heat.common import exception
|
||||||
|
@ -60,7 +61,8 @@ class NeutronClientPlugin(client_plugin.ClientPlugin):
|
||||||
'session': con.keystone_session,
|
'session': con.keystone_session,
|
||||||
'service_type': self.NETWORK,
|
'service_type': self.NETWORK,
|
||||||
'interface': interface,
|
'interface': interface,
|
||||||
'region_name': self._get_region_name()
|
'region_name': self._get_region_name(),
|
||||||
|
'connect_retries': cfg.CONF.client_retry_limit
|
||||||
}
|
}
|
||||||
|
|
||||||
return nc.Client(**args)
|
return nc.Client(**args)
|
||||||
|
|
|
@ -90,6 +90,7 @@ class NovaClientPlugin(microversion_mixin.MicroversionMixin,
|
||||||
'endpoint_type': endpoint_type,
|
'endpoint_type': endpoint_type,
|
||||||
'service_type': self.COMPUTE,
|
'service_type': self.COMPUTE,
|
||||||
'region_name': self._get_region_name(),
|
'region_name': self._get_region_name(),
|
||||||
|
'connect_retries': cfg.CONF.client_retry_limit,
|
||||||
'http_log_debug': self._get_client_option(CLIENT_NAME,
|
'http_log_debug': self._get_client_option(CLIENT_NAME,
|
||||||
'http_log_debug')
|
'http_log_debug')
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from oslo_config import cfg
|
||||||
from saharaclient.api import base as sahara_base
|
from saharaclient.api import base as sahara_base
|
||||||
from saharaclient import client as sahara_client
|
from saharaclient import client as sahara_client
|
||||||
import six
|
import six
|
||||||
|
@ -38,6 +39,7 @@ class SaharaClientPlugin(client_plugin.ClientPlugin):
|
||||||
'endpoint_type': endpoint_type,
|
'endpoint_type': endpoint_type,
|
||||||
'service_type': self.DATA_PROCESSING,
|
'service_type': self.DATA_PROCESSING,
|
||||||
'session': con.keystone_session,
|
'session': con.keystone_session,
|
||||||
|
'connect_retries': cfg.CONF.client_retry_limit,
|
||||||
'region_name': self._get_region_name()
|
'region_name': self._get_region_name()
|
||||||
}
|
}
|
||||||
client = sahara_client.Client('1.1', **args)
|
client = sahara_client.Client('1.1', **args)
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from oslo_config import cfg
|
||||||
from troveclient import client as tc
|
from troveclient import client as tc
|
||||||
from troveclient import exceptions
|
from troveclient import exceptions
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ class TroveClientPlugin(client_plugin.ClientPlugin):
|
||||||
'endpoint_type': endpoint_type,
|
'endpoint_type': endpoint_type,
|
||||||
'service_type': self.DATABASE,
|
'service_type': self.DATABASE,
|
||||||
'session': con.keystone_session,
|
'session': con.keystone_session,
|
||||||
|
'connect_retries': cfg.CONF.client_retry_limit,
|
||||||
'region_name': self._get_region_name()
|
'region_name': self._get_region_name()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,7 @@ class KeystoneClientTest(common.HeatTestCase):
|
||||||
self.m_client.assert_called_once_with(
|
self.m_client.assert_called_once_with(
|
||||||
session=utils.AnyInstance(ks_session.Session),
|
session=utils.AnyInstance(ks_session.Session),
|
||||||
auth=self.mock_ks_auth,
|
auth=self.mock_ks_auth,
|
||||||
|
connect_retries=2,
|
||||||
region_name=None)
|
region_name=None)
|
||||||
|
|
||||||
def _stubs_auth(self, method='token', trust_scoped=True,
|
def _stubs_auth(self, method='token', trust_scoped=True,
|
||||||
|
@ -167,6 +168,7 @@ class KeystoneClientTest(common.HeatTestCase):
|
||||||
if self.client:
|
if self.client:
|
||||||
self.m_client.assert_any_call(
|
self.m_client.assert_any_call(
|
||||||
session=utils.AnyInstance(ks_session.Session),
|
session=utils.AnyInstance(ks_session.Session),
|
||||||
|
connect_retries=2,
|
||||||
region_name=None)
|
region_name=None)
|
||||||
if self.stub_admin_auth:
|
if self.stub_admin_auth:
|
||||||
self.mock_admin_ks_auth.get_user_id.assert_called_once_with(
|
self.mock_admin_ks_auth.get_user_id.assert_called_once_with(
|
||||||
|
@ -1428,6 +1430,7 @@ class KeystoneClientTestDomainName(KeystoneClientTest):
|
||||||
self.m_client.assert_called_once_with(
|
self.m_client.assert_called_once_with(
|
||||||
session=utils.AnyInstance(ks_session.Session),
|
session=utils.AnyInstance(ks_session.Session),
|
||||||
auth=self.mock_ks_auth,
|
auth=self.mock_ks_auth,
|
||||||
|
connect_retries=2,
|
||||||
region_name=None)
|
region_name=None)
|
||||||
|
|
||||||
def _stub_domain_admin_client(self, domain_id='adomain123'):
|
def _stub_domain_admin_client(self, domain_id='adomain123'):
|
||||||
|
|
Loading…
Reference in New Issue