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