Skip to content

Commit

Permalink
Merge pull request #265 from Codeacious/jrm_identities_fix
Browse files Browse the repository at this point in the history
Fixed SSHAuthOptions to compare against something that Twisted won't touch
  • Loading branch information
dnephin committed Aug 7, 2013
2 parents b904457 + 92eba4b commit 1573fdf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tron/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,22 @@ class SSHAuthOptions(object):
"""An options class which can be used by NoPasswordAuthClient. This supports
the interface provided by: twisted.conch.client.options.ConchOptions.
"""
def __init__(self, identitys, use_agent):
def __init__(self, identitys, use_agent, config):
self.use_agent = use_agent
self.identitys = identitys
self._config = config

@classmethod
def from_config(cls, ssh_config):
return cls(ssh_config.identities, ssh_config.agent)
return cls(ssh_config.identities, ssh_config.agent, ssh_config)

def __getitem__(self, item):
if item != 'noagent':
raise KeyError(item)
return not self.use_agent

def __eq__(self, other):
return other and (
self.use_agent == other.use_agent and
self.identitys == other.identitys)
return other and other._config == self._config

def __ne__(self, other):
return not self == other
Expand Down

0 comments on commit 1573fdf

Please sign in to comment.