mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
dns: do not rely on custom param fields in record attributes
Obtain the information provided by the `hint` kwarg and `dnsrecord_part` and `dnsrecord_extra` flags by other means. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
@@ -25,7 +25,8 @@ import copy
|
||||
|
||||
from ipaclient.frontend import MethodOverride, CommandOverride
|
||||
from ipalib import errors
|
||||
from ipalib.dns import (get_record_rrtype,
|
||||
from ipalib.dns import (get_part_rrtype,
|
||||
get_record_rrtype,
|
||||
has_cli_options,
|
||||
iterate_rrparams_by_parts,
|
||||
record_name_format)
|
||||
@@ -63,7 +64,7 @@ def prompt_parts(rrtype, cmd, mod_dnsvalue=None):
|
||||
name, mod_dnsvalue)['result']
|
||||
|
||||
user_options = {}
|
||||
parts = [p for p in cmd.params() if 'dnsrecord_part' in p.flags]
|
||||
parts = [p for p in cmd.params() if get_part_rrtype(p.name) == rrtype]
|
||||
if not parts:
|
||||
return user_options
|
||||
|
||||
@@ -80,7 +81,7 @@ def prompt_parts(rrtype, cmd, mod_dnsvalue=None):
|
||||
|
||||
def prompt_missing_parts(rrtype, cmd, kw, prompt_optional=False):
|
||||
user_options = {}
|
||||
parts = [p for p in cmd.params() if 'dnsrecord_part' in p.flags]
|
||||
parts = [p for p in cmd.params() if get_part_rrtype(p.name) == rrtype]
|
||||
if not parts:
|
||||
return user_options
|
||||
|
||||
|
||||
Reference in New Issue
Block a user