Merge "conditional import of shlex_quote"

This commit is contained in:
Jenkins 2017-06-20 17:33:01 +00:00 committed by Gerrit Code Review
commit abfe37c330
1 changed files with 9 additions and 0 deletions

View File

@ -25,6 +25,15 @@ SSH = imp.load_source(
os.path.join(os.path.dirname(conn.__file__), 'ssh.py')
)
if not hasattr(SSH, 'shlex_quote'):
# NOTE(cloudnull): Later versions of ansible has this attribute already
# however this is not set in all versions. Because we use
# this method the attribute will set within the plugin
# if it's not found.
from ansible.compat.six.moves import shlex_quote
setattr(SSH, 'shlex_quote', shlex_quote)
class Connection(SSH.Connection):
"""Transport options for LXC containers.