summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2016-03-03 11:26:15 +0100
committerMartin Basti <mbasti@redhat.com>2016-04-13 17:44:56 +0200
commitbea066c33647c16a7b18deb1392838acb831ac88 (patch)
tree88ba0b9cd6c7272dd54ec28f161f4091972ce625 /ipalib
parent9a0f92be0dc1dc22827c918b5808b1ccb4e4b409 (diff)
downloadfreeipa-bea066c33647c16a7b18deb1392838acb831ac88.tar.gz
freeipa-bea066c33647c16a7b18deb1392838acb831ac88.tar.xz
freeipa-bea066c33647c16a7b18deb1392838acb831ac88.zip
host_del: remove unneeded dnszone-show command call
This command has no effect in that block of code, dnsrecord_show is enough for detection if records exists. https://fedorahosted.org/freeipa/ticket/5675 Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/host.py30
1 files changed, 12 insertions, 18 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index ef0738041..b22768aa0 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -764,28 +764,22 @@ class host_del(LDAPDelete):
# Remove DNS entries
parts = fqdn.split('.')
domain = unicode('.'.join(parts[1:]))
+ # Get all forward resources for this host
try:
- result = api.Command['dnszone_show'](domain)['result']
- domain = result['idnsname'][0]
+ record = api.Command['dnsrecord_show'](
+ domain, parts[0])['result']
except errors.NotFound:
self.obj.handle_not_found(*keys)
else:
- # Get all forward resources for this host
- try:
- record = api.Command['dnsrecord_show'](
- domain, parts[0])['result']
- except errors.NotFound:
- pass
- else:
- for attr in _record_attributes:
- for val in record.get(attr, []):
- if attr in ('arecord', 'aaaarecord'):
- remove_fwd_ptr(val, parts[0], domain, attr)
- elif (val.endswith(parts[0]) or
- val.endswith(fqdn + '.')):
- delkw = {unicode(attr): val}
- api.Command['dnsrecord_del'](
- domain, record['idnsname'][0], **delkw)
+ for attr in _record_attributes:
+ for val in record.get(attr, []):
+ if attr in ('arecord', 'aaaarecord'):
+ remove_fwd_ptr(val, parts[0], domain, attr)
+ elif (val.endswith(parts[0]) or
+ val.endswith(fqdn + '.')):
+ delkw = {unicode(attr): val}
+ api.Command['dnsrecord_del'](
+ domain, record['idnsname'][0], **delkw)
if self.api.Command.ca_is_enabled()['result']:
try: