summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ipa_replica_prepare.py
diff options
context:
space:
mode:
authorMartin Babinsky <mbabinsk@redhat.com>2016-04-15 17:05:11 +0200
committerMartin Basti <mbasti@redhat.com>2016-04-19 17:07:12 +0200
commit6baed5be75e1de92b22b86536c532e43edfba530 (patch)
tree1486ee8e117f341b8e7db1790369bf92e612f68e /ipaserver/install/ipa_replica_prepare.py
parent5dfaeca7cedec4e692a51b653e0c303e3bcb981d (diff)
downloadfreeipa-6baed5be75e1de92b22b86536c532e43edfba530.tar.gz
freeipa-6baed5be75e1de92b22b86536c532e43edfba530.tar.xz
freeipa-6baed5be75e1de92b22b86536c532e43edfba530.zip
replica-prepare: do not add PTR records if there is no IPA managed reverse zone
ipa-replica-prepare could crash during addition of replica's PTR records if there was no reverse zone managed by IPA and 'bindinstance.find_reverse_zone' returns an unhandled None. The code will now issue a warning and skip the PTR record addition in this case. https://fedorahosted.org/freeipa/ticket/5740 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaserver/install/ipa_replica_prepare.py')
-rw-r--r--ipaserver/install/ipa_replica_prepare.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ipaserver/install/ipa_replica_prepare.py b/ipaserver/install/ipa_replica_prepare.py
index 17d203220..fdd32f0c8 100644
--- a/ipaserver/install/ipa_replica_prepare.py
+++ b/ipaserver/install/ipa_replica_prepare.py
@@ -520,6 +520,11 @@ class ReplicaPrepare(admintool.AdminTool):
if not options.no_reverse:
reverse_zone = bindinstance.find_reverse_zone(ip)
+ if reverse_zone is None:
+ self.log.warning(
+ "Could not find any IPA managed reverse zone. "
+ "Not creating PTR records")
+ return
try:
add_ptr_rr(reverse_zone, ip_address, self.replica_fqdn)
except errors.PublicError as e: