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

Override default peer options based on args #104

Merged
merged 2 commits into from
Aug 25, 2016
Merged

Conversation

prashantv
Copy link
Contributor

If defaults sets the hosts file, but args sets a single peer, the
final options should only contain the single peer. If both are set,
yab returns an error.

This is required if we want to set a default peer list in a global
config that is only used when the user doesn't override the peer in
any way.

If defaults sets the hosts file, but args sets a single peer, the
final options should only contain the single peer. If both are set,
yab returns an error.

This is required if we want to set a default peer list in a global
config that is only used when the user doesn't override the peer in
any way.
@mention-bot
Copy link

@prashantv, thanks for your PR! By analyzing the annotation information on this pull request, we identified @blampe to be a potential reviewer


// Clear default peers if the user has specified peer options in args.
if len(argsOnly.TOpts.HostPorts) > 0 && defaults.TOpts.HostPortFile != "" {
defaults.TOpts.HostPortFile = ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need the second check? If you always set HostPortFile to "" when HostPorts is non-empty, you get the same result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, done

@abhinav
Copy link
Contributor

abhinav commented Aug 25, 2016

👍

@prashantv prashantv merged commit 5105e65 into dev Aug 25, 2016
@prashantv prashantv deleted the peer_list_config branch August 25, 2016 18:46
ZymoticB pushed a commit to ZymoticB/yab that referenced this pull request Aug 26, 2016
If defaults sets the hosts file, but args sets a single peer, the
final options should only contain the single peer. If both are set,
yab returns an error.

This is required if we want to set a default peer list in a global
config that is only used when the user doesn't override the peer in
any way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants