Replaced the print() outputs to the sys.stdout.write()
Change-Id: Ib6dad45ba72383e19a616ca5ed601fb38f0701ce
diff --git a/tests/test_vm2vm.py b/tests/test_vm2vm.py
index e60a7fd..4367ee8 100644
--- a/tests/test_vm2vm.py
+++ b/tests/test_vm2vm.py
@@ -1,4 +1,5 @@
import logging
+import sys
import time
import pytest
@@ -185,18 +186,17 @@
logger.info("Drawing the table with iperf results...")
result_table.add_rows(table_rows)
- print('\n{}'.format(result_table.draw()))
+ sys.stdout.write('\n{}\n'.format(result_table.draw()))
- print("Removing VMs and FIPs...")
logger.info("Removing VMs and FIPs...")
for vm in vms:
openstack_clients.compute.servers.delete(vm)
- print("Removing FIPs...")
+ logger.info("Removing FIPs...")
for fip in fips:
openstack_clients.compute.floating_ips.delete(fip)
except Exception as e:
- print(e)
- print("Something went wrong")
+ sys.stdout.write("\n{}".format(e))
+ sys.stdout.write("\nSomething went wrong\n")
if 'vms' in locals():
logger.info("Removing VMs...")
for vm in vms:
@@ -206,5 +206,5 @@
for fip in fips:
openstack_clients.compute.floating_ips.delete(fip)
else:
- print("Skipping cleaning, VMs were not created")
+ sys.stdout.write("\nSkipping cleaning, VMs were not created")
pytest.fail("Something went wrong")