Fix RemoteClient usage in scenario tests
Some scenario tests use the following patter to work with RemoteClient:
client = self.get_remote_client(ip,
private_key=keypair.private_key)
return client.ssh_client
ssh_client is directly accessed because exec_command method
is not directly available in RemoteClient
In order to preserve encapsulation, RemoteClient should be improved to
expose that method.
Change-Id: I054762d769d002b5fb45c871d85a8ca8ff294695
Closes-Bug: #1285539
diff --git a/tempest/scenario/test_snapshot_pattern.py b/tempest/scenario/test_snapshot_pattern.py
index 37beb07..562020a 100644
--- a/tempest/scenario/test_snapshot_pattern.py
+++ b/tempest/scenario/test_snapshot_pattern.py
@@ -45,11 +45,10 @@
def _ssh_to_server(self, server_or_ip):
try:
- linux_client = self.get_remote_client(server_or_ip)
+ return self.get_remote_client(server_or_ip)
except Exception:
LOG.exception()
self._log_console_output()
- return linux_client.ssh_client
def _write_timestamp(self, server_or_ip):
ssh_client = self._ssh_to_server(server_or_ip)