def execute_ssh_command(client, cmd):
try:<EOL><INDENT>stdin, stdout, stderr = client.exec_command(cmd)<EOL>err = stderr.read()<EOL>out = stdout.read()<EOL>if err:<EOL><INDENT>raise IpaSSHException(out.decode() + err.decode())<EOL><DEDENT><DEDENT>except:  <EOL><INDENT>raise<EOL><DEDENT>return out.decode()<EOL>
Execute given command using paramiko.

Returns:
    String output of cmd execution.
Raises:
    IpaSSHException: If stderr returns a non-empty string.