diff --git a/heat-config-kubelet/install.d/hook-kubelet.py b/heat-config-kubelet/install.d/hook-kubelet.py index 72ff0f9..ca50509 100755 --- a/heat-config-kubelet/install.d/hook-kubelet.py +++ b/heat-config-kubelet/install.d/hook-kubelet.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -import io import json import logging import os @@ -82,13 +81,13 @@ def configure_logging(): handler.setFormatter(formatter) log.addHandler(handler) - deploy_stdout = io.StringIO() + deploy_stdout = six.StringIO() handler = logging.StreamHandler(deploy_stdout) handler.setFormatter(formatter) handler.setLevel('DEBUG') log.addHandler(handler) - deploy_stderr = io.StringIO() + deploy_stderr = six.StringIO() handler = logging.StreamHandler(deploy_stderr) handler.setFormatter(formatter) handler.setLevel('WARN') diff --git a/tests/test_heat_config_notify.py b/tests/test_heat_config_notify.py index 15ca558..6f6b02c 100644 --- a/tests/test_heat_config_notify.py +++ b/tests/test_heat_config_notify.py @@ -11,7 +11,6 @@ # License for the specific language governing permissions and limitations # under the License. -import io import json import tempfile @@ -77,10 +76,7 @@ class HeatConfigNotifyTest(common.RunScriptTest): super(HeatConfigNotifyTest, self).setUp() self.deployed_dir = self.useFixture(fixtures.TempDir()) hcn.init_logging = mock.MagicMock() - if six.PY2: - self.stdin = io.BytesIO() - else: - self.stdin = io.StringIO() + self.stdin = six.StringIO() def write_config_file(self, data): config_file = tempfile.NamedTemporaryFile(mode='w') diff --git a/tests/test_hook_chef.py b/tests/test_hook_chef.py index 05968dc..2c78ac9 100644 --- a/tests/test_hook_chef.py +++ b/tests/test_hook_chef.py @@ -13,7 +13,6 @@ import copy import imp -import io import json import logging import mock @@ -59,12 +58,8 @@ class HookChefTest(common.RunScriptTest): __file__, '..', 'heat-config-chef/install.d/hook-chef.py') - if six.PY2: - sys.stdin = io.BytesIO() - sys.stdout = io.BytesIO() - else: - sys.stdin = io.StringIO() - sys.stdout = io.StringIO() + sys.stdin = six.StringIO() + sys.stdout = six.StringIO() def tearDown(self): super(HookChefTest, self).tearDown()