fix lint errors
This commit is contained in:
parent
0bcea916a2
commit
6d816a17bc
@ -164,11 +164,12 @@ func (i *Iptable) Notify(m *machine.EventMessage) {
|
|||||||
case machine.ENTERSTATEEVENT:
|
case machine.ENTERSTATEEVENT:
|
||||||
switch m.Dest {
|
switch m.Dest {
|
||||||
case "start_create":
|
case "start_create":
|
||||||
if e := i.Create(ctx); e != nil {
|
if e := i.Create(ctx); e == nil {
|
||||||
if triggerErr := i.stater.Trigger("created"); triggerErr != nil {
|
if triggerErr := i.stater.Trigger("created"); triggerErr == nil {
|
||||||
// transition error
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
i.State = "absent"
|
||||||
case "present":
|
case "present":
|
||||||
i.State = "present"
|
i.State = "present"
|
||||||
}
|
}
|
||||||
|
@ -153,11 +153,12 @@ func (n *NetworkRoute) Notify(m *machine.EventMessage) {
|
|||||||
case machine.ENTERSTATEEVENT:
|
case machine.ENTERSTATEEVENT:
|
||||||
switch m.Dest {
|
switch m.Dest {
|
||||||
case "start_create":
|
case "start_create":
|
||||||
if e := n.Create(ctx); e != nil {
|
if e := n.Create(ctx); e == nil {
|
||||||
if triggerErr := n.stater.Trigger("created"); triggerErr != nil {
|
if triggerErr := n.stater.Trigger("created"); triggerErr == nil {
|
||||||
// transition error
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
n.State = "absent"
|
||||||
case "present":
|
case "present":
|
||||||
n.State = "present"
|
n.State = "present"
|
||||||
}
|
}
|
||||||
|
@ -109,11 +109,12 @@ func (p *Package) Notify(m *machine.EventMessage) {
|
|||||||
case machine.ENTERSTATEEVENT:
|
case machine.ENTERSTATEEVENT:
|
||||||
switch m.Dest {
|
switch m.Dest {
|
||||||
case "start_create":
|
case "start_create":
|
||||||
if e := p.Create(ctx); e != nil {
|
if e := p.Create(ctx); e == nil {
|
||||||
if triggerErr := p.stater.Trigger("created"); triggerErr != nil {
|
if triggerErr := p.stater.Trigger("created"); triggerErr == nil {
|
||||||
// transition error
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
p.State = "absent"
|
||||||
case "present":
|
case "present":
|
||||||
p.State = "present"
|
p.State = "present"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user