Skip to content

add option to disable dns lookup for chronyc#1265

Closed
zbindenren wants to merge 1 commit intoinfluxdata:masterfrom
zbindenren:chrony-add-reverse-lookup-option
Closed

add option to disable dns lookup for chronyc#1265
zbindenren wants to merge 1 commit intoinfluxdata:masterfrom
zbindenren:chrony-add-reverse-lookup-option

Conversation

@zbindenren
Copy link
Contributor

@zbindenren zbindenren commented May 25, 2016

Make reverse lookups of time server configurable.

Required for all PRs:

  • CHANGELOG.md updated
  • Sign CLA (if not already signed)
  • README.md updated (if adding a new plugin)

return errors.New("chronyc not found: verify that chrony is installed and that chronyc is in your PATH")
}
cmd := execCommand(c.path, "tracking")
flags := []string{"-n", "tracking"}
Copy link
Contributor

Choose a reason for hiding this comment

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

seems more explicit to add flags to the array if you want them, rather than remove when you don't.

I would change to:

flags := []string{}
if !c.DNSLookup {
  flags = append(flags, "-n")
}
flags = append(flags, "tracking")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it.

@sparrc sparrc closed this in a8334c3 May 25, 2016
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