diff options
author | Toshio Kuratomi <a.badger@gmail.com> | 2016-09-06 22:54:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-06 22:54:17 -0700 |
commit | 4ed88512e45112f9670560ac3f01707a40a7f5c5 (patch) | |
tree | 56a676d07eed2b298cde420decffa947a3869ff7 /bin | |
parent | 7a9395b5e0059836fd510f252a9753229c4c24cc (diff) | |
download | ansible-4ed88512e45112f9670560ac3f01707a40a7f5c5.tar.gz |
Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423)
We couldn't copy to_unicode, to_bytes, to_str into module_utils because
of licensing. So once created it we had two sets of functions that did
the same things but had different implementations. To remedy that, this
change removes the ansible.utils.unicode versions of those functions.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ansible | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/ansible b/bin/ansible index be4edc2308..c7abff0180 100755 --- a/bin/ansible +++ b/bin/ansible @@ -43,7 +43,7 @@ from multiprocessing import Lock import ansible.constants as C from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError from ansible.utils.display import Display -from ansible.utils.unicode import to_unicode +from ansible.module_utils._text import to_text ######################################## @@ -97,10 +97,10 @@ if __name__ == '__main__': except AnsibleOptionsError as e: cli.parser.print_help() - display.error(to_unicode(e), wrap_text=False) + display.error(to_text(e), wrap_text=False) exit_code = 5 except AnsibleParserError as e: - display.error(to_unicode(e), wrap_text=False) + display.error(to_text(e), wrap_text=False) exit_code = 4 # TQM takes care of these, but leaving comment to reserve the exit codes # except AnsibleHostUnreachable as e: @@ -110,16 +110,16 @@ if __name__ == '__main__': # display.error(str(e)) # exit_code = 2 except AnsibleError as e: - display.error(to_unicode(e), wrap_text=False) + display.error(to_text(e), wrap_text=False) exit_code = 1 except KeyboardInterrupt: display.error("User interrupted execution") exit_code = 99 except Exception as e: have_cli_options = cli is not None and cli.options is not None - display.error("Unexpected Exception: %s" % to_unicode(e), wrap_text=False) + display.error("Unexpected Exception: %s" % to_text(e), wrap_text=False) if not have_cli_options or have_cli_options and cli.options.verbosity > 2: - display.display(u"the full traceback was:\n\n%s" % to_unicode(traceback.format_exc())) + display.display(u"the full traceback was:\n\n%s" % to_text(traceback.format_exc())) else: display.display("to see the full traceback, use -vvv") exit_code = 250 |