Skip to content
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

ssh and pssh prefer primary_tag as hostname #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frsyuki
Copy link
Contributor

@frsyuki frsyuki commented Aug 1, 2019

ssh and pssh commands were using the first element of search results but
it doesn't work well when tags option is set at ~/.hotdog/config.yml
and the first element is not a hostname.

This change prefers to use primary_key instead of the first element if
primary_key is set and primary_key is included in the tags option.

If tags option is not set or display_search_tags option is set, behavior
doesn't change because primary_key exists as the first element.

ssh and pssh commands were using the first element of search results but
it doesn't work well when `tags` option is set at ~/.hotdog/config.yml
and the first element is not a hostname.

This change prefers to use primary_key instead of the first element if
primary_key is set and primary_key is included in the tags option.

If tags option is not set or display_search_tags option is set, behavior
doesn't change because primary_key exists as the first element.
@yyuu
Copy link
Owner

yyuu commented Aug 1, 2019

I think, this kind of tag handling is better to be implemented within "get_hosts()" instead of individual commands impl 🤔

https://github.com/yyuu/hotdog/blob/v1.20190725.0/lib/hotdog/commands.rb#L104-L108

@frsyuki
Copy link
Contributor Author

frsyuki commented Aug 2, 2019

yes. please use this PR in anyways as you would like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants