summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-09-10 15:33:04 +0000
committerGerrit Code Review <review@openstack.org>2019-09-10 15:33:04 +0000
commit06f8ee55241911797517eef3474af47ef58fbff2 (patch)
tree7aeb570c419d26a2b55613b1adb7dd0030400df2
parent467883204627b2969c93d9789dc49bdcbd759551 (diff)
parent494c7a3c52c370a3f29c3eef3a5d92b3c4ff8648 (diff)
downloadheat-06f8ee55241911797517eef3474af47ef58fbff2.tar.gz
Merge "Use connect_retries when creating clients" into stable/rocky
-rw-r--r--heat/engine/clients/os/aodh.py2
-rw-r--r--heat/engine/clients/os/barbican.py2
-rw-r--r--heat/engine/clients/os/blazar.py2
-rw-r--r--heat/engine/clients/os/cinder.py2
-rw-r--r--heat/engine/clients/os/glance.py2
-rw-r--r--heat/engine/clients/os/heat_plugin.py1
-rw-r--r--heat/engine/clients/os/keystone/heat_keystoneclient.py2
-rw-r--r--heat/engine/clients/os/magnum.py2
-rw-r--r--heat/engine/clients/os/manila.py2
-rw-r--r--heat/engine/clients/os/neutron/__init__.py4
-rw-r--r--heat/engine/clients/os/nova.py1
-rw-r--r--heat/engine/clients/os/sahara.py2
-rw-r--r--heat/engine/clients/os/trove.py2
-rw-r--r--heat/tests/clients/test_heat_client.py3
14 files changed, 28 insertions, 1 deletions
diff --git a/heat/engine/clients/os/aodh.py b/heat/engine/clients/os/aodh.py
index f734f8778..e8aab0957 100644
--- a/heat/engine/clients/os/aodh.py
+++ b/heat/engine/clients/os/aodh.py
@@ -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):
diff --git a/heat/engine/clients/os/barbican.py b/heat/engine/clients/os/barbican.py
index 76400f8c8..ddde40dd2 100644
--- a/heat/engine/clients/os/barbican.py
+++ b/heat/engine/clients/os/barbican.py
@@ -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 heat.common import exception
from heat.engine.clients import client_plugin
@@ -33,6 +34,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
diff --git a/heat/engine/clients/os/blazar.py b/heat/engine/clients/os/blazar.py
index 3095d4651..a0c46f99d 100644
--- a/heat/engine/clients/os/blazar.py
+++ b/heat/engine/clients/os/blazar.py
@@ -13,6 +13,7 @@
from blazarclient import client as blazar_client
from keystoneauth1.exceptions import http as ks_exc
+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)
diff --git a/heat/engine/clients/os/cinder.py b/heat/engine/clients/os/cinder.py
index 7e876efd5..7ffce206c 100644
--- a/heat/engine/clients/os/cinder.py
+++ b/heat/engine/clients/os/cinder.py
@@ -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')
}
diff --git a/heat/engine/clients/os/glance.py b/heat/engine/clients/os/glance.py
index 59970b4cc..caa306d4f 100644
--- a/heat/engine/clients/os/glance.py
+++ b/heat/engine/clients/os/glance.py
@@ -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):
diff --git a/heat/engine/clients/os/heat_plugin.py b/heat/engine/clients/os/heat_plugin.py
index fb5132893..76cdf990d 100644
--- a/heat/engine/clients/os/heat_plugin.py
+++ b/heat/engine/clients/os/heat_plugin.py
@@ -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)
diff --git a/heat/engine/clients/os/keystone/heat_keystoneclient.py b/heat/engine/clients/os/keystone/heat_keystoneclient.py
index 315c57313..fcb72fcb2 100644
--- a/heat/engine/clients/os/keystone/heat_keystoneclient.py
+++ b/heat/engine/clients/os/keystone/heat_keystoneclient.py
@@ -152,12 +152,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.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.region_name)
if hasattr(self.context.auth_plugin, 'get_access'):
diff --git a/heat/engine/clients/os/magnum.py b/heat/engine/clients/os/magnum.py
index 216f4ece9..310b81c8d 100644
--- a/heat/engine/clients/os/magnum.py
+++ b/heat/engine/clients/os/magnum.py
@@ -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)
diff --git a/heat/engine/clients/os/manila.py b/heat/engine/clients/os/manila.py
index 15f612e63..f5adf1937 100644
--- a/heat/engine/clients/os/manila.py
+++ b/heat/engine/clients/os/manila.py
@@ -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)
diff --git a/heat/engine/clients/os/neutron/__init__.py b/heat/engine/clients/os/neutron/__init__.py
index 97201bb2b..060088907 100644
--- a/heat/engine/clients/os/neutron/__init__.py
+++ b/heat/engine/clients/os/neutron/__init__.py
@@ -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)
diff --git a/heat/engine/clients/os/nova.py b/heat/engine/clients/os/nova.py
index 031fffa8f..aacc03038 100644
--- a/heat/engine/clients/os/nova.py
+++ b/heat/engine/clients/os/nova.py
@@ -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')
}
diff --git a/heat/engine/clients/os/sahara.py b/heat/engine/clients/os/sahara.py
index 0718fc877..2627f6127 100644
--- a/heat/engine/clients/os/sahara.py
+++ b/heat/engine/clients/os/sahara.py
@@ -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)
diff --git a/heat/engine/clients/os/trove.py b/heat/engine/clients/os/trove.py
index c645300b7..14fbc2880 100644
--- a/heat/engine/clients/os/trove.py
+++ b/heat/engine/clients/os/trove.py
@@ -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()
}
diff --git a/heat/tests/clients/test_heat_client.py b/heat/tests/clients/test_heat_client.py
index aa6840819..835ee76d3 100644
--- a/heat/tests/clients/test_heat_client.py
+++ b/heat/tests/clients/test_heat_client.py
@@ -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(
@@ -1428,6 +1430,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'):