mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #34605 from gtmanfred/2016.3
catch error if no dns domains exist
This commit is contained in:
commit
b88c39e1d2
1 changed files with 7 additions and 2 deletions
|
@ -769,7 +769,7 @@ def destroy(name, call=None):
|
|||
log.debug('Deleting DNS records for {0}.'.format(name))
|
||||
destroy_dns_records(name)
|
||||
|
||||
# Until the "to do" from line 748 is taken care of, we don't need this logic.
|
||||
# Until the "to do" from line 754 is taken care of, we don't need this logic.
|
||||
# if delete_dns_record:
|
||||
# log.debug('Deleting DNS records for {0}.'.format(name))
|
||||
# destroy_dns_records(name)
|
||||
|
@ -845,7 +845,12 @@ def destroy_dns_records(fqdn):
|
|||
'''
|
||||
domain = '.'.join(fqdn.split('.')[-2:])
|
||||
hostname = '.'.join(fqdn.split('.')[:-2])
|
||||
response = query(method='domains', droplet_id=domain, command='records')
|
||||
# TODO: remove this when the todo on 754 is available
|
||||
try:
|
||||
response = query(method='domains', droplet_id=domain, command='records')
|
||||
except SaltCloudSystemExit:
|
||||
log.debug('Failed to find domains.')
|
||||
return False
|
||||
log.debug("found DNS records: {0}".format(pprint.pformat(response)))
|
||||
records = response['domain_records']
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue