diff options
Diffstat (limited to 'yardstick/ssh.py')
-rw-r--r-- | yardstick/ssh.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/yardstick/ssh.py b/yardstick/ssh.py index bb715e4b4..e98ee98b7 100644 --- a/yardstick/ssh.py +++ b/yardstick/ssh.py @@ -64,6 +64,7 @@ Eventlet: """ from __future__ import absolute_import import os +import io import select import socket import time @@ -81,6 +82,14 @@ from yardstick.common.utils import try_int from yardstick.network_services.utils import provision_tool +def convert_key_to_str(key): + if not isinstance(key, (paramiko.RSAKey, paramiko.DSSKey)): + return key + k = io.StringIO() + key.write_private_key(k) + return k.getvalue() + + class SSHError(Exception): pass |