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
This commit is contained in:
Rob Crittenden authored and Martin Nagy committed 2010-03-07 12:29:31 +01:00
1 parent 789cba4378
commit 96d7de9cae
1 file changed
+2 -2
+2 -2
View File
@@ -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):