Merge "Fix unknown event type message in logs"
This commit is contained in:
commit
f0523a3808
@ -108,6 +108,11 @@ var genericContainerOperationToString = map[GenericContainerOperation]string{
|
|||||||
GenericContainerStop: "GenericContainerStop",
|
GenericContainerStop: "GenericContainerStop",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var baremetalInventoryOperationToString = map[BaremetalManagerStep]string{
|
||||||
|
BaremetalManagerStart: "BaremetalOperationStart",
|
||||||
|
BaremetalManagerComplete: "BaremetalOperationComplete",
|
||||||
|
}
|
||||||
|
|
||||||
//Normalize cast Event to GenericEvent type
|
//Normalize cast Event to GenericEvent type
|
||||||
func Normalize(e Event) GenericEvent {
|
func Normalize(e Event) GenericEvent {
|
||||||
var eventType string
|
var eventType string
|
||||||
@ -131,6 +136,9 @@ func Normalize(e Event) GenericEvent {
|
|||||||
case GenericContainerType:
|
case GenericContainerType:
|
||||||
operation = genericContainerOperationToString[e.GenericContainerEvent.Operation]
|
operation = genericContainerOperationToString[e.GenericContainerEvent.Operation]
|
||||||
message = e.GenericContainerEvent.Message
|
message = e.GenericContainerEvent.Message
|
||||||
|
case BaremetalManagerEventType:
|
||||||
|
operation = baremetalInventoryOperationToString[e.BaremetalManagerEvent.Step]
|
||||||
|
message = e.BaremetalManagerEvent.Message
|
||||||
}
|
}
|
||||||
|
|
||||||
return GenericEvent{
|
return GenericEvent{
|
||||||
|
@ -57,8 +57,8 @@ func (e *BaremetalManagerExecutor) Run(evtCh chan events.Event, opts ifc.RunOpti
|
|||||||
evtCh <- events.NewEvent().WithBaremetalManagerEvent(events.BaremetalManagerEvent{
|
evtCh <- events.NewEvent().WithBaremetalManagerEvent(events.BaremetalManagerEvent{
|
||||||
Step: events.BaremetalManagerStart,
|
Step: events.BaremetalManagerStart,
|
||||||
HostOperation: string(e.options.Spec.Operation),
|
HostOperation: string(e.options.Spec.Operation),
|
||||||
Message: fmt.Sprintf("Starting remote operation, selector to be to filter hosts %v",
|
Message: fmt.Sprintf("Starting remote operation '%s', selector to be to filter hosts %v",
|
||||||
e.options.Spec.HostSelector),
|
e.options.Spec.Operation, e.options.Spec.HostSelector),
|
||||||
})
|
})
|
||||||
|
|
||||||
op, err := e.validate()
|
op, err := e.validate()
|
||||||
|
Loading…
Reference in New Issue
Block a user