diff options
author | root <root@webui.pzuna> | 2010-05-04 14:12:55 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-05-04 13:39:42 -0400 |
commit | a3d1b1755965c73a758acb1ec4992bf2428fa37b (patch) | |
tree | 0e37d6991e9269e0cd40c832e70ef93fe5e89bf9 | |
parent | 3ea044fb59bf6ada2c0e9b507c1d6c4dfd8aaa23 (diff) | |
download | freeipa-a3d1b1755965c73a758acb1ec4992bf2428fa37b.tar.gz freeipa-a3d1b1755965c73a758acb1ec4992bf2428fa37b.tar.xz freeipa-a3d1b1755965c73a758acb1ec4992bf2428fa37b.zip |
Add weekly periodic schedule to AccessTime param type.
Fix bug #588414
-rw-r--r-- | ipalib/parameters.py | 2 | ||||
-rw-r--r-- | tests/test_ipalib/test_parameters.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 612ec329..589a092b 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -1525,6 +1525,8 @@ class AccessTime(Str): index = self._check_Y_spec(ts, 2) elif ts[1] == 'monthly': index = self._check_M_spec(ts, 2) + elif ts[1] == 'weekly': + index = self._check_W_spec(ts, 2) elif ts[1] == 'daily': index = 1 if index is None: diff --git a/tests/test_ipalib/test_parameters.py b/tests/test_ipalib/test_parameters.py index e14538c5..84d73530 100644 --- a/tests/test_ipalib/test_parameters.py +++ b/tests/test_ipalib/test_parameters.py @@ -1372,19 +1372,18 @@ class test_AccessTime(ClassChecker): for value in (u'absolute 201012161032 ~ 201012161033', u'periodic monthly week 2 day Sat,Sun 0900-1300', u'periodic yearly month 4 day 1-31 0800-1400', + u'periodic weekly day 7 0800-1400', u'periodic daily 0800-1400', ): assert rule(dummy, value) is None assert dummy.called() is False - # FIXME, weekly is not implemented in AccessTime -# u'periodic weekly day 8 0800-1400', - # And some bad ones for value in (u'absolute 201012161032 - 201012161033', u'absolute 201012161032 ~', u'periodic monthly day Sat,Sun 0900-1300', u'periodical yearly month 4 day 1-31 0800-1400', + u'periodic weekly day 8 0800-1400', ): e = raises(ValidationError, o._rule_required, None, value) |