Skip to content

Instantly share code, notes, and snippets.

@mattias-lidman
Created October 17, 2014 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattias-lidman/8e4b5c32fe55bad73ba4 to your computer and use it in GitHub Desktop.
Save mattias-lidman/8e4b5c32fe55bad73ba4 to your computer and use it in GitHub Desktop.
d7a0daae (Mattias Lidman 2013-09-10 17:54:06 -0500)| 3 def ssh_pubkeys(self):
d7a0daae (Mattias Lidman 2013-09-10 17:54:06 -0500)| 2 creds = self.credentials.get_all_credentials_of_type('ssh2')
d7a0daae (Mattias Lidman 2013-09-10 17:54:06 -0500)| 1 creds_dict = []
d7a0daae (Mattias Lidman 2013-09-10 17:54:06 -0500)|493 # TODO: We're already getting type=ssh2, is this necessary?
d7a0daae (Mattias Lidman 2013-09-10 17:54:06 -0500)| 1 for cred in creds:
d7a0daae (Mattias Lidman 2013-09-10 17:54:06 -0500)| 2 if cred.attributes['credential_type'] == 'ssh2':
d7a0daae (Mattias Lidman 2013-09-10 17:54:06 -0500)| 3 creds_dict.append({'credential_type' : 'ssh2', 'ssh_key' : cred.attributes['ssh_key']})
d7a0daae (Mattias Lidman 2013-09-10 17:54:06 -0500)| 4 return creds_dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment