summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-03-05 13:38:26 -0500
committerMartin Nagy <mnagy@redhat.com>2010-03-07 12:29:31 +0100
commit96d7de9cae4bd8eadd96c59f8b49aac3623ec135 (patch)
treea995e3cd0b4ad0e7741e3cfc667a5b68a76151ef
parent789cba4378a14c1651a780559e2103aef3d8d67a (diff)
downloadfreeipa-96d7de9cae4bd8eadd96c59f8b49aac3623ec135.tar.gz
freeipa-96d7de9cae4bd8eadd96c59f8b49aac3623ec135.tar.xz
freeipa-96d7de9cae4bd8eadd96c59f8b49aac3623ec135.zip
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
-rw-r--r--ipalib/plugins/pwpolicy.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py
index a10d07d4e..9580d1574 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):