Merge pull request #12447 from mgedmin/py3k
Python 3: there is no 'basestring'
This commit is contained in:
commit
86566e691a
1 changed files with 5 additions and 4 deletions
|
@ -19,16 +19,17 @@
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
from six.moves import StringIO
|
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import stat
|
import stat
|
||||||
import sys
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
from six.moves import StringIO
|
||||||
|
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible.errors import AnsibleError, AnsibleConnectionFailure
|
from ansible.errors import AnsibleError, AnsibleConnectionFailure
|
||||||
from ansible.executor.module_common import modify_module
|
from ansible.executor.module_common import modify_module
|
||||||
|
@ -463,12 +464,12 @@ class ActionBase:
|
||||||
rc, stdin, stdout, stderr = self._connection.exec_command(cmd, tmp, in_data=in_data, sudoable=sudoable)
|
rc, stdin, stdout, stderr = self._connection.exec_command(cmd, tmp, in_data=in_data, sudoable=sudoable)
|
||||||
self._display.debug("command execution done")
|
self._display.debug("command execution done")
|
||||||
|
|
||||||
if not isinstance(stdout, basestring):
|
if not isinstance(stdout, string_types):
|
||||||
out = ''.join(stdout.readlines())
|
out = ''.join(stdout.readlines())
|
||||||
else:
|
else:
|
||||||
out = stdout
|
out = stdout
|
||||||
|
|
||||||
if not isinstance(stderr, basestring):
|
if not isinstance(stderr, string_types):
|
||||||
err = ''.join(stderr.readlines())
|
err = ''.join(stderr.readlines())
|
||||||
else:
|
else:
|
||||||
err = stderr
|
err = stderr
|
||||||
|
|
Loading…
Reference in a new issue