mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Fixed modules/system py files for 2.4 to 3.5 exceptions (#2367)
This commit is contained in:
parent
868a4584a4
commit
891245c6f6
12 changed files with 95 additions and 56 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue