mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Change parameters to use only default_from for dynamic default values.
Replace all occurences of create_default with equivalent default_from and remove create_default from the framework. This is needed for proper parameter validation, as there is no way to tell which parameters to validate prior to calling create_default, because create_default does not provide information about which parameters are used for generating the default value.
This commit is contained in:
committed by
Martin Kosek
parent
5a55e11a25
commit
a2299070c8
@@ -234,7 +234,7 @@ def _rname_validator(ugettext, zonemgr):
|
||||
return unicode(e)
|
||||
return None
|
||||
|
||||
def _create_zone_serial(**kwargs):
|
||||
def _create_zone_serial():
|
||||
""" Generate serial number for zones. The format follows RFC 1912 """
|
||||
return int('%s01' % time.strftime('%Y%m%d'))
|
||||
|
||||
@@ -1554,7 +1554,7 @@ class dnszone(LDAPObject):
|
||||
label=_('SOA serial'),
|
||||
doc=_('SOA record serial number'),
|
||||
minvalue=1,
|
||||
create_default=_create_zone_serial,
|
||||
default_from=_create_zone_serial,
|
||||
autofill=True,
|
||||
),
|
||||
Int('idnssoarefresh',
|
||||
|
||||
Reference in New Issue
Block a user