Skip to content

Commit

Permalink
Sort the plugins so the order is consintent
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed May 18, 2015
1 parent de9c1f5 commit 34e87e7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,16 @@ func (agent *Agent) Connect() error {
func (a *Agent) LoadPlugins() ([]string, error) {
var names []string

for name, creator := range plugins.Plugins {
plugin := creator()
var pluginNames []string

for name, _ := range plugins.Plugins {
pluginNames = append(pluginNames, name)
}

sort.Strings(pluginNames)

for _, name := range pluginNames {
plugin := plugins.Plugins[name]()

err := a.Config.Apply(name, plugin)
if err != nil {
Expand Down

0 comments on commit 34e87e7

Please sign in to comment.