From f451063ef2b40aa958a140d8cc07721f1ae9397a Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 25 Jul 2013 21:51:29 -0400 Subject: [PATCH] fixed error on detecting missing requirements Signed-off-by: Brian Coca --- library/files/acl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/files/acl b/library/files/acl index a9a46bbb029..a95a032c93f 100644 --- a/library/files/acl +++ b/library/files/acl @@ -60,11 +60,11 @@ EXAMPLES = ''' # Removes the acl for joe - acl: name=/etc/foo.conf entry="u:joe:-" state=absent ''' - +NO_PYLIBACL=False try: import posix1e except: - module.fail_json(msg="Could not import required module pylibacl (posix1e)") + NO_PYLIBACL=True def main(): module = AnsibleModule( @@ -76,6 +76,10 @@ def main(): ), supports_check_mode=True, ) + + if NO_PYLIBACL: + module.fail_json(msg="Could not import required module pylibacl (posix1e)") + path = module.params.get('name') entry = module.params.get('entry') state = module.params.get('state')