summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-01-28 08:25:47 -0500
committerRob Crittenden <rcritten@redhat.com>2011-01-28 10:24:41 -0500
commit7a75464a301f59213c48aeaa624201db09966f53 (patch)
tree721a63cfa071951790a0ce33a4306741d74426ae /ipalib
parent884f43f0db6da9243dd4315bdb9b481935be2456 (diff)
downloadfreeipa-7a75464a301f59213c48aeaa624201db09966f53.tar.gz
freeipa-7a75464a301f59213c48aeaa624201db09966f53.tar.xz
freeipa-7a75464a301f59213c48aeaa624201db09966f53.zip
host-add should not add a PTR record with --no-reverse
https://fedorahosted.org/freeipa/ticket/866
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/host.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index 0bc7947a7..d5c517479 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -356,13 +356,16 @@ class host_add(LDAPCreate):
except errors.EmptyModlist:
# the entry already exists and matches
pass
- revzone, revname = get_reverse_zone(options['ip_address'])
- try:
- addkw = { 'ptrrecord' : keys[-1]+'.' }
- api.Command['dnsrecord_add'](revzone, revname, **addkw)
- except errors.EmptyModlist:
- # the entry already exists and matches
- pass
+
+ if not options.get('no_reverse', False):
+ revzone, revname = get_reverse_zone(options['ip_address'])
+ try:
+ addkw = { 'ptrrecord' : keys[-1]+'.' }
+ api.Command['dnsrecord_add'](revzone, revname, **addkw)
+ except errors.EmptyModlist:
+ # the entry already exists and matches
+ pass
+
del options['ip_address']
except Exception, e:
exc = e