mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Fix undefined variables, basestring usage, and some associated python3 issues
This commit is contained in:
@@ -81,8 +81,9 @@ EXAMPLES = '''
|
||||
'''
|
||||
|
||||
import re
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
import subprocess
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
def main():
|
||||
@@ -161,8 +162,7 @@ def main():
|
||||
)
|
||||
|
||||
module.exit_json(changed=True)
|
||||
except subprocess.CalledProcessError:
|
||||
e = get_exception()
|
||||
except subprocess.CalledProcessError as cpe:
|
||||
module.fail_json(msg=str(dir(cpe)))
|
||||
else:
|
||||
module.exit_json(changed=False)
|
||||
|
||||
Reference in New Issue
Block a user