From 96d7de9cae4bd8eadd96c59f8b49aac3623ec135 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 5 Mar 2010 13:38:26 -0500 Subject: Don't calculate min/max lifetime if None is passed in. None is passed if the option is set with --minlife=''. This is a valid use case to delete a non-required attribute. In this case we simply don't do the math on None and things work as expected. 569847 --- ipalib/plugins/pwpolicy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ipalib/plugins/pwpolicy.py') diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py index a10d07d4..9580d157 100644 --- a/ipalib/plugins/pwpolicy.py +++ b/ipalib/plugins/pwpolicy.py @@ -53,9 +53,9 @@ def _convert_time_for_output(entry_attrs): def _convert_time_on_input(entry_attrs): # Convert hours and days to seconds for writing to LDAP - if 'krbmaxpwdlife' in entry_attrs: + if 'krbmaxpwdlife' in entry_attrs and entry_attrs['krbmaxpwdlife']: entry_attrs['krbmaxpwdlife'] = entry_attrs['krbmaxpwdlife'] * 86400 - if 'krbminpwdlife' in entry_attrs: + if 'krbminpwdlife' in entry_attrs and entry_attrs['krbminpwdlife']: entry_attrs['krbminpwdlife'] = entry_attrs['krbminpwdlife'] * 3600 def find_group_dn(group): -- cgit