From 4ecf85392e25549fcd2b565c3c8b78d0a1eccb90 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Fri, 14 Jul 2017 15:41:03 +0200 Subject: [PATCH] udm_user: fix broken import Tested with: from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta n = datetime.now() assert n + timedelta(days=365) == n + relativedelta(years=1) --- lib/ansible/modules/cloud/univention/udm_user.py | 5 ++--- test/sanity/import/skip.txt | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/cloud/univention/udm_user.py b/lib/ansible/modules/cloud/univention/udm_user.py index 4af21488e0..e83752645b 100644 --- a/lib/ansible/modules/cloud/univention/udm_user.py +++ b/lib/ansible/modules/cloud/univention/udm_user.py @@ -334,8 +334,7 @@ EXAMPLES = ''' RETURN = '''# ''' import crypt -from datetime import date -from dateutil.relativedelta import relativedelta +from datetime import date, timedelta from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.univention_umc import ( @@ -347,7 +346,7 @@ from ansible.module_utils.univention_umc import ( def main(): - expiry = date.strftime(date.today() + relativedelta(years=1), "%Y-%m-%d") + expiry = date.strftime(date.today() + timedelta(days=365), "%Y-%m-%d") module = AnsibleModule( argument_spec = dict( birthday = dict(default=None, diff --git a/test/sanity/import/skip.txt b/test/sanity/import/skip.txt index acd1b6bfa1..267f8bdb19 100644 --- a/test/sanity/import/skip.txt +++ b/test/sanity/import/skip.txt @@ -44,7 +44,6 @@ lib/ansible/modules/cloud/google/gc_storage.py lib/ansible/modules/cloud/google/gcdns_record.py lib/ansible/modules/cloud/google/gcdns_zone.py lib/ansible/modules/cloud/ovirt/ovirt_disks.py -lib/ansible/modules/cloud/univention/udm_user.py lib/ansible/modules/cloud/webfaction/webfaction_app.py lib/ansible/modules/cloud/webfaction/webfaction_db.py lib/ansible/modules/cloud/webfaction/webfaction_domain.py