New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SSHConfig method returning hostnames defined in SSH config #167

Merged
merged 1 commit into from Sep 19, 2014

Conversation

Projects
None yet
4 participants
@kwi-dk
Contributor

kwi-dk commented May 13, 2013

For my application, I need to distinguish between explicit host configuration entries and configuration entries synthesized from wildcard entries (e.g. '*'), something which is not possibly using SSHConfig.lookup().

I figure I might not be the only one, hence the pull request. Unit test is included.

Best regards,
Søren Løvborg

@lndbrg

This comment has been minimized.

Contributor

lndbrg commented Aug 14, 2014

Why not! I'm +1 on this.

@lndbrg lndbrg added Feature labels Aug 14, 2014

@kwi-dk

This comment has been minimized.

Contributor

kwi-dk commented Sep 11, 2014

Sorry for the delay, I had completely forgottten about this. It's been a while. :)

I actually no longer need this feature; considering that nobody else spoke up for 16 months, I wonder if it'll just end up collecting dust... thoughts? If there's still interest, I'll look into rebasing the pull request against latest master.

@bitprophet

This comment has been minimized.

Member

bitprophet commented Sep 17, 2014

I think it sounds useful enough, and it's tiny & additive (doesn't mutate existing code) so if you have the inclination, by all means.

I'm keeping my head (barely) above water on incoming Github notifications now, so if you post an update (may need to comment - don't think new commits trigger) I should see it and be able to pull it in.

@@ -254,3 +254,12 @@ def _expand_variables(self, config, hostname):
else:
config[k] = config[k].replace(find, str(replace))
return config
def get_hostnames(self):

This comment has been minimized.

@lndbrg

lndbrg Sep 17, 2014

Contributor

Could be written as such with a set comprehension:

return {entry['host'] for entry in self._config}

This comment has been minimized.

@bitprophet

bitprophet Sep 19, 2014

Member

That's Python 2.7 only unfortunately :)

@kwi-dk kwi-dk force-pushed the kwi-dk:master branch from ad52ca4 to 8e2d432 Sep 19, 2014

@kwi-dk

This comment has been minimized.

Contributor

kwi-dk commented Sep 19, 2014

I've rebased against latest master. The Travis CI build succeeded for all Python versions except 3.3, where it timed out after 13 minutes. I doubt that it was my code that caused that, though I don't have a Python 3.3 installation readily accessible to check... :-)

@lndbrg

This comment has been minimized.

Contributor

lndbrg commented Sep 19, 2014

Will retrigger.

@coveralls

This comment has been minimized.

coveralls commented Sep 19, 2014

Coverage Status

Coverage decreased (-0.36%) when pulling 8e2d432 on kwi-dk:master into 5b83284 on paramiko:master.

@bitprophet bitprophet added this to the 2.0 milestone Sep 19, 2014

@bitprophet bitprophet merged commit 8e2d432 into paramiko:master Sep 19, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

bitprophet added a commit that referenced this pull request Sep 19, 2014

@bitprophet bitprophet removed this from the 2.0 milestone Dec 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment