Sort the plugins so the order is consintent

This commit is contained in:
Evan Phoenix 2015-05-18 11:54:59 -07:00
parent de9c1f50ea
commit 34e87e7026
1 changed files with 10 additions and 2 deletions

View File

@ -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 {