Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fix case where paramiko doesn't find any ssh keys #15

merged 1 commit into from

2 participants


At least some versions of paramiko's ssh agent objects are born without a keys attribute if they don't have any keys, as opposed to agent.keys as empty list. Check for that case with hasattr before checking whether the keys attribute is falsy

@epall epall merged commit 7da57d0 into epall:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2013
  1. @jmathes
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1 
2 
@@ -109,7 +109,7 @@ def launch(username_p, host_p, remote_path, port_p=None):
def get_ssh_key():
agent = paramiko.Agent()
- if agent.keys:
+ if hasattr(agent, 'keys') and agent.keys:
# TODO: support having more than one key loaded
if len(agent.keys) > 1:
print ("You have more than one key in your SSH Agent"
Something went wrong with that request. Please try again.