summaryrefslogtreecommitdiffstats
path: root/ipaclient/plugins
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2017-02-23 13:21:59 +0000
committerDavid Kupka <dkupka@redhat.com>2017-03-08 15:52:41 +0100
commit1e912f5b83166154806e0382f3f028d0eac81731 (patch)
tree38be9b09b3f8d8de03f235362e615ca01486a845 /ipaclient/plugins
parent25fa2bb6c9fa1b498330b13c9a6116b646eb75ba (diff)
downloadfreeipa-1e912f5b83166154806e0382f3f028d0eac81731.tar.gz
freeipa-1e912f5b83166154806e0382f3f028d0eac81731.tar.xz
freeipa-1e912f5b83166154806e0382f3f028d0eac81731.zip
dns: fix `dnsrecord_add` interactive mode
`dnsrecord_add` interactive mode might prompt for value of non-existent arguments `a_part_create_reverse` and `aaaa_part_create_reverse`. This happens because `dnsrecord_add` extra flags are incorrectly defined as parts of the respective DNS records. Remove extra flags from DNS record parts to fix the interactive mode on old clients talking to new servers. Skip non-existent arguments in the interactive mode to fix new clients talking to old servers. https://fedorahosted.org/freeipa/ticket/6457 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaclient/plugins')
-rw-r--r--ipaclient/plugins/dns.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ipaclient/plugins/dns.py b/ipaclient/plugins/dns.py
index 2d3c5e238..f67189757 100644
--- a/ipaclient/plugins/dns.py
+++ b/ipaclient/plugins/dns.py
@@ -73,6 +73,10 @@ def prompt_parts(rrtype, cmd, mod_dnsvalue=None):
return user_options
for part_id, part in enumerate(rrobj.params()):
+ name = part_name_format % (rrtype.lower(), part.name)
+ if name not in cmd.params:
+ continue
+
if mod_parts:
default = mod_parts[part_id]
else:
@@ -92,6 +96,8 @@ def prompt_missing_parts(rrtype, cmd, kw, prompt_optional=False):
for part in rrobj.params():
name = part_name_format % (rrtype.lower(), part.name)
+ if name not in cmd.params:
+ continue
if name in kw:
continue