Skip to content

Commit

Permalink
Init each cluster with the default before itself
Browse files Browse the repository at this point in the history
  • Loading branch information
svaroqui committed Mar 25, 2017
1 parent 2f92977 commit 1986816
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion cluster/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ func (cluster *Cluster) TopologyDiscover() error {
err := m.Connect()
if err != nil {
cluster.sme.AddState("ERR00018", state.State{ErrType: "ERROR", ErrDesc: fmt.Sprintf(clusterError["ERR00018"], err), ErrFrom: "CONF"})

}
}

Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ func initConfig() {
for _, gl := range cfgGroupList {

if gl != "" {
cf2 := viper.Sub("Default")
cf2.Unmarshal(&conf)
cfgGroup = gl
log.WithField("group", gl).Debug("Reading configuration group")
cf2 := viper.Sub(gl)
cf2 = viper.Sub(gl)
if cf2 == nil {
log.WithField("group", gl).Fatal("Could not parse configuration group")
}
Expand Down
2 changes: 1 addition & 1 deletion state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (SM *StateMachine) GetStates() []string {
func (SM *StateMachine) GetOpenStates() []string {
var log []string
SM.Lock()
for key, value := range *SM.CurState {
for key, value := range *SM.OldState {
log = append(log, fmt.Sprintf("%-5s: %s %s", value.ErrType, key, value.ErrDesc))
}
SM.Unlock()
Expand Down

0 comments on commit 1986816

Please sign in to comment.