summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--snaps/openstack/tests/create_instance_tests.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/snaps/openstack/tests/create_instance_tests.py b/snaps/openstack/tests/create_instance_tests.py
index 1ef96fd..19173d2 100644
--- a/snaps/openstack/tests/create_instance_tests.py
+++ b/snaps/openstack/tests/create_instance_tests.py
@@ -1766,18 +1766,17 @@ def validate_ssh_client(instance_creator):
if ssh_client:
try:
out = ssh_client.exec_command('pwd')[1]
+ channel = out.channel
+ in_buffer = channel.in_buffer
+ pwd_out = in_buffer.read(1024)
+ if not pwd_out or len(pwd_out) < 10:
+ return False
+ return True
finally:
ssh_client.close()
else:
return False
- channel = out.channel
- in_buffer = channel.in_buffer
- pwd_out = in_buffer.read(1024)
- if not pwd_out or len(pwd_out) < 10:
- return False
- return True
-
return False