Not native, but text (#55676)

* use to_text instead of to_native
* cleaned up some imports and other pyflakisms
* fix missing lib messages
This commit is contained in:
Brian Coca 2019-05-24 14:49:04 -04:00 committed by GitHub
parent 6e66ea9f78
commit 27dcf8aaab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 33 additions and 35 deletions

View file

@ -10,7 +10,6 @@ __metaclass__ = type
import glob
import os
import os.path
import pkgutil
import sys
import warnings
@ -56,7 +55,7 @@ def add_all_plugin_dirs(path):
if os.path.isdir(plugin_path):
obj.add_directory(to_text(plugin_path))
else:
display.warning("Ignoring invalid path provided to plugin path: '%s' is not a directory" % to_native(path))
display.warning("Ignoring invalid path provided to plugin path: '%s' is not a directory" % to_text(path))
def get_shell_plugin(shell_type=None, executable=None):
@ -522,7 +521,7 @@ class PluginLoader:
if isinstance(ex, AnsibleError):
raise
# log and continue, likely an innocuous type/package loading failure in collections import
display.debug('has_plugin error: {0}'.format(to_native(ex)))
display.debug('has_plugin error: {0}'.format(to_text(ex)))
__contains__ = has_plugin