python3 compatiblity

remove use of basestring
deal with configparser
This commit is contained in:
Brian Coca 2016-03-16 14:12:48 -07:00
commit 5b11494437
5 changed files with 13 additions and 7 deletions

View file

@ -60,8 +60,9 @@ import socket
import random
import time
import codecs
import ConfigParser
import uuid
from ansible.compat.six.moves import configparser
try:
import certifi
HAS_CERTIFI = True
@ -212,7 +213,7 @@ class CallbackModule(CallbackBase):
'Disabling the Logentries callback plugin.')
config_path = os.path.abspath(os.path.dirname(__file__))
config = ConfigParser.ConfigParser()
config = configparser.ConfigParser()
try:
config.readfp(open(os.path.join(config_path, 'logentries.ini')))
if config.has_option('logentries', 'api'):

View file

@ -79,7 +79,7 @@ class Connection(ConnectionBase):
p = subprocess.Popen(
cmd,
shell=isinstance(cmd, basestring),
shell=isinstance(cmd, (text_type, binary_type)),
executable=executable, #cwd=...
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,