From bb91fcabee352fcaa71c8e66998a25e01cfaf9f7 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Tue, 18 Jun 2019 15:43:46 +0200 Subject: [PATCH] dnsrecord-mod: allow to modify ttl without passing the record The command ipa dnsrecord-mod --ttl requires to provide at least one record to modify. When none is specified, it prompts by proposing each of the existing records, for instance: ipa dnsrecord-mod ZZZZZ.org ns11 --ttl=86400 No option to modify specific record provided. Current DNS record contents: A record: xxx.xxx.xxx.xxx AAAA record: xxxx:xx Modify A record 'xxxx.xxxx.xxxx.xxxx'? Yes/No (default No): Modify AAAA record 'xxxx:xx'? Yes/No (default No): ipa: ERROR: No options to modify a specific record provided. The admin should be able to modify the TTL value without re-entering the record information. The issue happens because of an internal check that forgot to consider 'dnsttl' as a valid standalone modification. Fixes: https://pagure.io/freeipa/issue/7982 Reviewed-By: Rob Crittenden Reviewed-By: Christian Heimes Reviewed-By: Alexander Bokovoy --- ipalib/dns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipalib/dns.py b/ipalib/dns.py index 95c7989b6..45f1eb67e 100644 --- a/ipalib/dns.py +++ b/ipalib/dns.py @@ -55,7 +55,7 @@ def get_extra_rrtype(name): def has_cli_options(cmd, options, no_option_msg, allow_empty_attrs=False): - sufficient = ('setattr', 'addattr', 'delattr', 'rename') + sufficient = ('setattr', 'addattr', 'delattr', 'rename', 'dnsttl') if any(k in options for k in sufficient): return