diff --git a/core/_tests/helpers/test_log_helpers.py b/core/_tests/helpers/test_log_helpers.py index 5ce83eed8..038867aa5 100644 --- a/core/_tests/helpers/test_log_helpers.py +++ b/core/_tests/helpers/test_log_helpers.py @@ -47,10 +47,10 @@ class TestLogWrap(unittest.TestCase): logger.assert_has_calls(( call.debug( - "Calling: func with args: {} {}".format( + "Calling: 'func' with args: {!r} {!r}".format( call_args, call_kwargs)), call.debug( - "Done: func with result: {}".format(result)) + "Done: 'func' with result: {!r}".format(result)) )) def test_negative(self, logger): @@ -66,10 +66,10 @@ class TestLogWrap(unittest.TestCase): logger.assert_has_calls(( call.debug( - "Calling: func with args: {} {}".format( + "Calling: 'func' with args: {!r} {!r}".format( call_args, call_kwargs)), call.exception( - 'func raised: ValueError({}, {})\n'.format( + "'func' raised: ValueError({}, {})\n".format( call_args, call_kwargs)) )) diff --git a/core/helpers/log_helpers.py b/core/helpers/log_helpers.py index 1fb28633d..0513d1a0a 100644 --- a/core/helpers/log_helpers.py +++ b/core/helpers/log_helpers.py @@ -24,17 +24,17 @@ def logwrap(func): @functools.wraps(func) def wrapped(*args, **kwargs): logger.debug( - "Calling: {} with args: {} {}".format( + "Calling: {!r} with args: {!r} {!r}".format( func.__name__, args, kwargs ) ) try: result = func(*args, **kwargs) logger.debug( - "Done: {} with result: {}".format(func.__name__, result)) + "Done: {!r} with result: {!r}".format(func.__name__, result)) except BaseException as e: logger.exception( - '{func} raised: {exc!r}\n'.format(func=func.__name__, exc=e)) + '{func!r} raised: {exc!r}\n'.format(func=func.__name__, exc=e)) raise return result return wrapped diff --git a/fuelweb_test/models/fuel_web_client.py b/fuelweb_test/models/fuel_web_client.py index 7fb4e7918..7da2c9c40 100644 --- a/fuelweb_test/models/fuel_web_client.py +++ b/fuelweb_test/models/fuel_web_client.py @@ -1069,8 +1069,7 @@ class FuelWebClient29(object): def get_cluster_block_devices(self, node_name): logger.info('Get %s node block devices (lsblk)', node_name) with self.get_ssh_for_node(node_name) as remote: - ret = remote.check_call('/bin/lsblk') - return ''.join(ret['stdout']) + return remote.check_call('/bin/lsblk').stdout_str @logwrap def get_pacemaker_status(self, controller_node_name): diff --git a/fuelweb_test/tests/test_ha_one_controller.py b/fuelweb_test/tests/test_ha_one_controller.py index d24c4a507..b2442d65f 100644 --- a/fuelweb_test/tests/test_ha_one_controller.py +++ b/fuelweb_test/tests/test_ha_one_controller.py @@ -13,6 +13,7 @@ # under the License. from __future__ import division +from __future__ import unicode_literals import re @@ -290,10 +291,12 @@ class HAOneControllerNeutron(HAOneControllerNeutronBase): self.fuel_web.run_ostf(cluster_id=cluster_id) _ip = self.fuel_web.get_nailgun_node_by_name("slave-03")['ip'] - result = self.ssh_manager.execute_on_remote(cmd='hiera roles', - ip=_ip)['stdout_str'] - assert_equal('[\"base-os\"]', result, - message="Role mismatch. Node slave-03 is not base-os") + result = self.ssh_manager.check_call( + command='hiera roles', ip=_ip).stdout_str + assert_equal( + '["base-os"]', + result, + message="Role mismatch. Node slave-03 is not base-os") self.env.make_snapshot("deploy_base_os_node") @@ -461,8 +464,7 @@ class MultiroleMultipleServices(TestBasic): "sed -i 's,http://archive.ubuntu.com/ubuntu,{0},g'" \ " /usr/share/fuel-mirror/ubuntu.yaml".format( ubuntu_url) - self.ssh_manager.execute_on_remote(ip=admin_ip, - cmd=replace_cmd) + self.ssh_manager.check_call(ip=admin_ip, command=replace_cmd) create_mirror_cmd = 'fuel-mirror create -P ubuntu -G mos ubuntu' self.env.admin_actions.ensure_cmd(create_mirror_cmd) @@ -486,7 +488,7 @@ class MultiroleMultipleServices(TestBasic): self.show_step(4) apply_mirror_cmd = 'fuel-mirror apply -P ubuntu -G mos ubuntu ' \ '--env {0} --replace'.format(cluster_id) - self.ssh_manager.execute_on_remote(ip=admin_ip, cmd=apply_mirror_cmd) + self.ssh_manager.check_call(ip=admin_ip, command=apply_mirror_cmd) self.fuel_web.update_nodes( cluster_id,