Fix getting ssh key if ssh path is not set

Add check for get_key function because it should return tuple,
but can also return None.

Closes-Bug: #1356820

Change-Id: I827a9a24c2decfa245d50d90bdee2b64b59da5b1