mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Remove deprecated get_exception API
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
caefe31125
commit
6bd0fbb63c
42 changed files with 284 additions and 409 deletions
|
@ -43,7 +43,6 @@ import re
|
|||
from subprocess import Popen, PIPE, call
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils._text import to_native
|
||||
|
||||
LOCALE_NORMALIZATION = {
|
||||
|
@ -228,9 +227,8 @@ def main():
|
|||
apply_change(state, name)
|
||||
else:
|
||||
apply_change_ubuntu(state, name)
|
||||
except EnvironmentError:
|
||||
e = get_exception()
|
||||
module.fail_json(msg=e.strerror, exitValue=e.errno)
|
||||
except EnvironmentError as e:
|
||||
module.fail_json(msg=to_native(e), exitValue=e.errno)
|
||||
|
||||
module.exit_json(name=name, changed=changed, msg="OK")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue