Remove support for updates via notifications

Remove support for the notifications method for automatically
creating DNS records in Queens+. This method for achieving Neutron
integration has been superseded both upstream and in the charms. By
removing support for it in Queens we prevent the charm from
attempting to make designate v1 api calls for Queens+ which
is a positive thing given it will have been removed *1

*1 https://docs.openstack.org/releasenotes/designate/queens.html#critical-issues

Change-Id: Ida107c748646cac621b551fad8290899c04e6b79
Closes-Bug: 1749423
This commit is contained in:
Liam Young 2018-02-14 11:39:41 +00:00
parent 269ba2bb1d
commit eed4594c72
2 changed files with 17 additions and 9 deletions

View File

@ -388,6 +388,12 @@ class DesignateCharm(openstack_charm.HAOpenStackCharm):
hookenv.log("Problem with 'dns-slaves' config: {}"
.format(str(e)), level=hookenv.ERROR)
def configure_sink(self):
cmp_os_release = ch_utils.CompareOpenStackReleases(
self.release
)
return cmp_os_release < 'queens'
@classmethod
@decorators.retry_on_exception(
40, base_delay=5, exc_type=subprocess.CalledProcessError)
@ -534,16 +540,17 @@ class DesignateCharm(openstack_charm.HAOpenStackCharm):
format(str(e)))
def custom_assess_status_check(self):
if (not hookenv.config('nameservers') and
(hookenv.config('nova-domain') or
hookenv.config('neutron-domain'))):
return 'blocked', ('nameservers must be set when specifying'
' nova-domain or neutron-domain')
dns_backend_available = (relations
.endpoint_from_flag('dns-backend.available'))
if self.configure_sink():
if (not hookenv.config('nameservers') and
(hookenv.config('nova-domain') or
hookenv.config('neutron-domain'))):
return 'blocked', ('nameservers must be set when specifying'
' nova-domain or neutron-domain')
invalid_dns = self.options.invalid_pool_config()
if invalid_dns:
return 'blocked', invalid_dns
dns_backend_available = (relations
.endpoint_from_flag('dns-backend.available'))
if not (dns_backend_available or hookenv.config('dns-slaves')):
return 'blocked', ('Need either a dns-backend relation or '
'config(dns-slaves) or both.')

View File

@ -172,8 +172,9 @@ def configure_designate_full(*args):
instance.render_full_config(args)
try:
# the following function should only run once for the leader.
instance.create_initial_servers_and_domains()
_render_sink_configs(instance, args)
if instance.configure_sink():
instance.create_initial_servers_and_domains()
_render_sink_configs(instance, args)
instance.render_rndc_keys()
instance.update_pools()
except subprocess.CalledProcessError as e: