Extend retry times and decorated funcs for retry

The designate charm uses the designate client to create server and
domain objects during unit setup. This relies on the local designate
service and keystone being up and responding. This has proved racey
and this change extends the functions which have the retry decorator
and extends the retry count.

Partial-Bug: #1729231

Change-Id: I35162817afe3ff770f5a8781a29f3be1642687ba
This commit is contained in:
Liam Young 2017-11-28 10:17:35 +00:00
parent 1e9720aa93
commit 9b7a81664a
1 changed files with 7 additions and 1 deletions

View File

@ -389,6 +389,8 @@ class DesignateCharm(openstack_charm.HAOpenStackCharm):
.format(str(e)), level=hookenv.ERROR)
@classmethod
@decorators.retry_on_exception(
40, base_delay=5, exc_type=subprocess.CalledProcessError)
def get_domain_id(cls, domain):
"""Return the domain ID for a given domain name
@ -405,6 +407,8 @@ class DesignateCharm(openstack_charm.HAOpenStackCharm):
return None
@classmethod
@decorators.retry_on_exception(
40, base_delay=5, exc_type=subprocess.CalledProcessError)
def create_domain(cls, domain, email):
"""Create a domain
@ -420,6 +424,8 @@ class DesignateCharm(openstack_charm.HAOpenStackCharm):
subprocess.check_call(create_cmd)
@classmethod
@decorators.retry_on_exception(
40, base_delay=5, exc_type=subprocess.CalledProcessError)
def create_server(cls, nsname):
""" create a nameserver entry with the supplied name
@ -439,7 +445,7 @@ class DesignateCharm(openstack_charm.HAOpenStackCharm):
@classmethod
@decorators.retry_on_exception(
10, base_delay=5, exc_type=subprocess.CalledProcessError)
40, base_delay=5, exc_type=subprocess.CalledProcessError)
def ensure_api_responding(cls):
"""Check that the api service is responding.