mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Fixed modules/system py files for 2.4 to 3.5 exceptions (#2367)
This commit is contained in:
@@ -57,6 +57,8 @@ EXAMPLES = '''
|
||||
- modprobe: name=dummy state=present params="numdummies=2"
|
||||
'''
|
||||
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
import shlex
|
||||
|
||||
|
||||
@@ -87,7 +89,8 @@ def main():
|
||||
present = True
|
||||
break
|
||||
modules.close()
|
||||
except IOError, e:
|
||||
except IOError:
|
||||
e = get_exception()
|
||||
module.fail_json(msg=str(e), **args)
|
||||
|
||||
# Check only; don't modify
|
||||
@@ -118,6 +121,4 @@ def main():
|
||||
|
||||
module.exit_json(**args)
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import *
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user