From 3f43879db8b51c5e95b9f6e1895e27e8e016d702 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 19 Oct 2016 13:07:04 +0200 Subject: [PATCH] Cleanup imports of xattr Since the module use re and os, we need to import them. And rather than importing '*', we should limit to the only object/function needed, so we can more easily refactor later. --- lib/ansible/modules/files/xattr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/files/xattr.py b/lib/ansible/modules/files/xattr.py index 378665477cf..8f12c853a28 100644 --- a/lib/ansible/modules/files/xattr.py +++ b/lib/ansible/modules/files/xattr.py @@ -73,6 +73,8 @@ EXAMPLES = ''' ''' import operator +import re +import os def get_xattr_keys(module,path,follow): cmd = [ module.get_bin_path('getfattr', True) ] @@ -202,7 +204,7 @@ def main(): module.exit_json(changed=changed, msg=msg, xattr=res) # import module snippets -from ansible.module_utils.basic import * - +from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.pycompat24 import get_exception if __name__ == '__main__': main()