Replaced the print() outputs to the sys.stdout.write()
Change-Id: Ib6dad45ba72383e19a616ca5ed601fb38f0701ce
diff --git a/utils/__init__.py b/utils/__init__.py
index 8e858b3..8b04bab 100644
--- a/utils/__init__.py
+++ b/utils/__init__.py
@@ -1,6 +1,7 @@
-import os
-import yaml
import logging
+import os
+import sys
+import yaml
from utils import os_client
@@ -22,8 +23,8 @@
cmp_hosts = config.get('CMP_HOSTS') or []
skipped_nodes = config.get('skipped_nodes') or []
if skipped_nodes:
- print(("\nNotice: {} nodes will be skipped for vm2vm test".format(
- ",".join(skipped_nodes))))
+ sys.stdout.write(("\nNotice: {} nodes will be skipped for vm2vm test"
+ "".format(",".join(skipped_nodes))))
logger.info("Skipping nodes {}".format(",".join(skipped_nodes)))
if not cmp_hosts:
openstack_clients = os_client.OfficialClientManager(
diff --git a/utils/helpers.py b/utils/helpers.py
index 800a9fe..add9e87 100644
--- a/utils/helpers.py
+++ b/utils/helpers.py
@@ -1,3 +1,5 @@
+import sys
+
import texttable as tt
@@ -21,4 +23,4 @@
for row in global_results:
tab.add_row(row)
s = tab.draw()
- print(s)
+ sys.stdout.write(s)
diff --git a/utils/os_client.py b/utils/os_client.py
index 8ef55de..e22ce19 100644
--- a/utils/os_client.py
+++ b/utils/os_client.py
@@ -1,3 +1,9 @@
+import logging
+import os
+import random
+import sys
+import time
+
from cinderclient import client as cinder_client
from glanceclient import client as glance_client
from keystoneauth1 import identity as keystone_identity
@@ -6,11 +12,6 @@
from neutronclient.v2_0 import client as neutron_client
from novaclient import client as novaclient
-import logging
-import os
-import random
-import time
-
import utils
logger = logging.getLogger(__name__)
@@ -64,7 +65,7 @@
tenant_name=None, auth_url=None, cert=None,
domain='Default'):
if None in (username, password, tenant_name):
- print((username, password, tenant_name))
+ sys.stdout.write((username, password, tenant_name))
msg = ("Missing required credentials for identity client. "
"username: {username}, password: {password}, "
"tenant_name: {tenant_name}").format(