In file generate_key.py when runner.run() throws error (https://github.com/Tendrl/commons/blob/develop/tendrl/commons/utils/ssh/generate_key.py#L55) the except section doesn't assign value to out variable and hence causes error at:
https://github.com/Tendrl/commons/blob/develop/tendrl/commons/utils/ssh/generate_key.py#L66
I feel this is a bug and will submit its patch.